C# :: User Requirements And Database Location
Mar 5, 2014
Right now my application database is stored in the AppDataRoamingAppName directory.
The client has requested that the administrator choose the location for the database, and have a choice between a local machine, or an online repository.
The clients are not IT people, they are business people, and I don't think it's a good idea to let a user choose where to keep the central app database. Other users (think admin vs user) will need to download the database for use on their own local machines, which is how the issue even came up, it's kind of a shared database that only the admin can add to.
My compromise was to COPY the main database to the location of the user's choosing, then push updates to it as the main database was written to.
So after working on this today, I have the user choose a directory, I add the file path to the application settings, then I create the file and copy the database as needed to the new location (online repositories are next).
View 6 Replies
ADVERTISEMENT
Sep 24, 2013
I have been trying to finish this code (function) for a while now, but am stuck on the last part. In this code, I prompt the user to select a number of integers and any number of digits and then find the smallest and largest value within these digits. On the next part, I am supposed to determine which of the given digits the smallest and largest are located such that the output should be:
Digit _ can be found in integer number(s): _, _
Here is what I have tried:
Code:
int digitSizeLoca() {
int userNumInteger;
int* iPtr;
int* iPtr2;
int* iPtr3;
int value;
[Code] ....
Seems to do the job, but it always outputs 1, 2...
View 4 Replies
View Related
Feb 21, 2012
How do you find, when you first introduced with say some of the STL container, function or algorithms, what are its requirements? I mean,
1. what operators object should have for specific container?
2. what function args and type it should return for a algo?
3. when extending some container like with custom allocator, char_traits...and what not, what methods should be overridden? What work should they do?
View 7 Replies
View Related
Jul 25, 2014
My program gets user input and compares it against an array of characters (guessLetters[x]) to decide whether the do/while loop repeats. The whole character array contains underscores yet if i enter any letter it goes into the if statement and repeats the do/while loop.
do {
repeatflag = false;
cin >> UserInput;
UserInput = toupper(UserInput);
[Code] .....
View 2 Replies
View Related
Jun 25, 2014
I'm trying to insert into the database I created, values entered by the user. But I can't find how to insert them it looks like this:
//Go for the user infos
cout << "What is your ID ? : ";
cin >> id;
cout << "What is you letter ? : ";
cin >> letter;
cout << "Your letter is "<<letter<< " and your ID is "<<id<<"
[Code] ....
I don't know how to proceed, I receive a error here for the sql2 statement
error C2296: '<<' : illegal, left operand has type 'const char [36]'
View 12 Replies
View Related
Aug 18, 2012
I was looking at this code:
private void button1_Click(object sender, EventArgs e)
{
string input = textBox3.Text;
[Code].....
And how to rewrite the code so that it display the MySQL table data for a specific user I already have a string called username and that stores the username entered on the login form. I want the code to use the username string to search for the name and display that users info.
My table contents are: username
First name
Last name
Position
Employee Id
Airline
View 7 Replies
View Related
Jul 12, 2013
In the code below. I believe I am returning the memory location of the value I am looking for. How can get the value?
main.cpp
int choice = 0;
PlayerMenu *newPM = new PlayerMenu;
File *file = new File;
// Menu for loading, creating or exiting the game
choice = newPM->menuChoices();
PlayerMenu.cpp
[Code] ....
I am not sure how to deference the value so I can get at the value instead of the memory location.
View 5 Replies
View Related
May 23, 2013
Here's my code, my problem is that it is not sending the keystrokes to the LOG.TXT file I want them to be going to.
1 #include <iostream>
2 using namespace std;
3 #include <windows.h>
4 #include <winuser.h>
5 #include <stdio.h>
6 int save (int key_stroke, char *file);
[Code] ....
View 1 Replies
View Related
Mar 14, 2015
How can i get the Location of an Image used by the ToolStripButton? I need the locaton to detect if the cursor is above the image that i use for the button. I tried it like this:
private void ToolStripButton_MouseHover(object sender, EventArgs e) {
Graphics formGraphics = this.CreateGraphics();
GraphicsUnit graphicsUnit = GraphicsUnit.Point;
RectangleF imageBoundsF = reloadToolStripButton.Image.GetBounds(ref graphicsUnit);
[code].....
The problem is that i have the width and the height but the location is always 0 or x and y are always 0, so how can i do it?
View 2 Replies
View Related
Jun 6, 2012
Any difference between
Code:
class SomeOtherClass;
void foo(SomeOtherClass* p);
And
Code:
void foo(class SomeOtherClass* p);
I was told that "2" would limit the scope of the forward declaration to the declaration of foo... However, after testing it, it appears that both behave the same...
View 3 Replies
View Related
Feb 1, 2014
I recently started learning C++ and wanted to deep a bit into process memory reading for Windows, but I get an error I don't know how to fix. I'm using Visual Studio Express 2013 as my IDE and it tells me this, when I try to run and debug:
"Unhandled exception at 0x77E3E243 (ntdll.dll) in readProcessMemory.exe: 0xC0000005: Access violation reading location 0x00000043."
The Call Stack window says following:
ntdll.dll!_NtRaiseException@12() Unknown
ntdll.dll!_KiUserExceptionDispatcher@8() Unknown
ntdll.dll!_RtlInitUnicodeString@8() Unknown
> readProcessMemory.exe!main() Line 8 C++
[External Code]
And in the Output window is this: First-chance exception at 0x77E3E243 (ntdll.dll) in readProcessMemory.exe: 0xC0000005: Access violation reading location 0x00000043. Unhandled exception at 0x77E3E243 (ntdll.dll) in readProcessMemory.exe: 0xC0000005: Access violation reading location 0x00000043.
My code should be extremely simple, I'm just trying to find a Windows window. But here's the code.
Code:
#include <windows.h>
#include <iostream>
using namespace std;
int main(){
[Code] ......
View 10 Replies
View Related
Aug 19, 2013
I have my libraries in ../../lib location
and when i try to compile :
gcc -O9 -I ../../include/ -L ../../lib/ -o test test.c thr.o -lm -lthread
I get :
gcc: error: thr.o: No such file or directory
obviously the problem is the library path location but my obj is there
ls -al ../../lib/ | grep thr.o
-rw-rw-r-- 1 xxxxxx xxxxxx 23544 Aug 12 23:03 thr.o
????
View 2 Replies
View Related
Aug 16, 2012
I have a 3d Point in space. From this point I have vertices defind by(scale). I have a Quaternion representing the rotation of the object (lets say a block). So...
(1) I know the point in local and world space and can translate.
(2) I know the scale of the object and it's starting vertices intersections at zero rotation.
(3) I have the quaternion which represents the 3d rotation and can translate that to degrees and Eulers.
How do i find the exact points of the vertices after the rotation. (what I'm attempting to do is plot points from vertice to vertice all along the sides/top/bottom of the object.)I have looked at Matrix4 transformations and Quaternions and still do not understand how to find the vertices after rotation.
View 8 Replies
View Related
Oct 21, 2014
I have these two functions listed below. DoEvent() gets called from a window procedure whenever some event occurs. SetEvent() sets an element of the m_Events array a pointer to a Command object to handle the event. The array is zeroed in the constructor.
The error occurs on line 16 in the code in DoEvent(). Why the array is suddenly unreadable. When I call SetEvent() it works just fine, no problem.
When I step through the debugger in SetEvent i see that each element begins as 0 and the element I set is set properly. However, when I step through DoEvent() all elements in m_Events show "?????" "Unable to read memory".
uw::Command* uw::WindowBase::SetEvent(uw::WindowEventsEnum event, uw::Command* command) {
if (event < 0 || event >= FINAL_EVENT_ENTRY)
return NULL;
Command* ret = m_Events[event];
m_Events[event] = command;
return ret;
[Code] ....
View 2 Replies
View Related
Jan 20, 2015
I already wrote:
strncpy(buff2, buff1[i], strlen(buff1)-i );
but this function seem to just copy from the beginning of a buffer to another, not from the ith element.Is there such a function?
Buff1&buff2 are char[10000] and i is declared int, holding the interesting element's position.
View 4 Replies
View Related
May 4, 2013
I have a problem. Im testing character movement in c++ and when i compile and run this, then try to press arrow keys it says "Access violation writing location 0x011feff4.Unhandled exception at 0x770a15de in test.exe: 0xC0000005: Access violation writing location 0x011feff4.The program '[8404] test.exe: Native' has exited with code -1073741819 (0xc0000005)."
#include <iostream>
#include <string>
#include <Windows.h>
#include <conio.h>
using namespace std;
void map1create(); // Function for creating the map1
[code]....
View 2 Replies
View Related
May 19, 2014
I know how to find the occurrences of a character in a string, but I have a more specific problem.
For example, consider the string:
" C 1.3825 4.0000 12.0000 1.9133 0.1853 0.9000 -1.1359 4.0000 "
I want to extract a vector that contains the positions of every first character for each number.
For the example above, the output should be a vector with elements [6 15 23 33 etc...]. These are the positions of the first character for every number.
I need to be able to do this for any arbitrary string with any arbitrary amount of numbers and characters in it (I also need to account for negative numbers).
View 1 Replies
View Related
Jul 9, 2013
this is my code in c++ and its very simpile but wont compile
#include <iostream>
using namespace std;
int main() {
cout << "Here is some text
";
cout << "Here is a number: ";
[Code] ...
View 1 Replies
View Related
Jan 3, 2013
I have a std::vector of short ints that I need to write to a specific location in a binary file (without using .NET code). To that end, I wrote up this code:
Code:
ofstream fileStream (filePathString, ios::out | ios::binary);
int curPos = 2821;
fileStream.seekp(curPos);
int iter = 0;
while (iter < 1024*1024){
char bytesToWrite[2];
//Low byte
bytesToWrite[0] = LOBYTE(dataVector[iter]);
[Code]...
The code runs without crashing, but when I look at the file afterwards in a hex editor, every byte (even those outside the range I thought I was writing to) are replaced with 00. I suspect I'm missing something in my understanding of file streams. Did I write that code correctly? Seekp does move the pointer over the next byte to be overwritten, yes? Am I getting a memory leak somewhere?
View 5 Replies
View Related
Oct 23, 2014
I just started deal with pointers in C, and one stuff confusing me...
Here is simple code:
int main (){
int var1 = 10;
int var2 = 20;
long ms = 10000000;
printf("Address of var1 variable: %p
", &var1 );
[Code] ...
But - when I run pmap - I don't see this addresses there:
Code:
# pmap -x 16496
16496: ./address
Address Kbytes RSS Dirty Mode Mapping
0000000000400000 4 4 0 r-x-- address
0000000000600000 4 4 4 rw--- address
00007f79cf8b8000 1576 260 0 r-x-- libc-2.12.so
00007f79cfa42000 2048 0 0 ----- libc-2.12.so
00007f79cfc42000 16 16 16 r---- libc-2.12.so
I guess - it's is inside stack:
Code:
# cat /proc/16496/maps | grep stack
7fff0d7e5000-7fff0d7fa000 rw-p 00000000 00:00 0 [stack]
But - how I can obtain this variables addreses, to see them with `pmap`? If I put them as "global":
Code: ...
#include <stdlib.h>
#include <sys/types.h>
int var1 = 10;
int var2 = 20;
int millisleep(unsigned ms);
int retpid(void);
[Code] ......
I have odd addresses in result:
Code:
Address of var1 variable: 0x600a94
Address of var2 variable: 0x600a98
View 1 Replies
View Related
May 28, 2014
I'm trying to make it possible to have a 2 dimensional linked list with syntax like with vectors:
List<List<std::string>> words(5, List<std::string>(5, "Hello"));
I coded everything so that this kind of syntax would be possible, but now, when I execute my program, I get the following error:
#include "stdafx.h"
#include <iostream>
#include "List.h"
[Code].....
View 18 Replies
View Related
Nov 8, 2013
All my code is good, except the functions: findMacLoc and findMinLoc .They don't give me the correct array location of the max/min number in the array.I know is something simple I need to tweak in those two functions.
#include <iostream>
#include <time.h>
using namespace std;
void printArray(int a [], int & size)
{
int i;
for (i = 0; i < size; i++)
cout << a[i] << " ";
[code].....
View 2 Replies
View Related
Mar 5, 2013
I am getting the message Access violation reading location 0xccccccc8. when i try to print my dynamic array during the overloaded << function in my Flight class. where the error happens is surrounded by *s
#include<iostream>
#include<vector>
#include<string>
[Code]....
View 4 Replies
View Related
Feb 2, 2014
I'm having trouble opening a file from a specific location.
#include "maidcafe.h"
....
char directory[80] = {"C:UsersPublicDocumentsAnime NotesTransaction"};
char code[20];
printf("Enter file name");
gets(code);
strcat(directory,code);
system("start "" %s",directory);
i thought this would work, but it didn't xD. I got an error
View 3 Replies
View Related
Jan 11, 2013
Under Microsoft, I use GlobalAlloc and GlobalFree to dynamically allocate and free memory. Intermittently GlobalFree is reporting error 998 (GetLastError() - Invalid access to memory location). I've checked my logs of addresses returned by GlobalAlloc against those being freed by GlobalFree and when the problem occurs the address causing the error has been allocated by GlobalAlloc and has not been freed before since allocation.
I can't reproduce it. Currently I'm checking for error 998 from GlobalFree and ignoring it if it occurs - which is not satisfactory. I have one function (AllocMem) that calls GlobalAlloc and checks for errors and another function (FreeMem) which calls GlobalFree and checks for errors.
My program uses AllocMem and FreeMem everywhere memory is required or freed. AllocMem and FreeMem are in a DLL. The program is heavily threaded and a different thread may call AllocMem to the one that calls FreeMem. I don't believe I've got a race condition etc as all the code in the program containing the AllocMem and FreeMem calls are part of a CriticalSection using the same variable.
What is a possible cause of this error?
View 14 Replies
View Related
Aug 7, 2014
I'm doing a card game and i'm unclear on how to retrieve the card by doing vectors. after i use use srand() in main and create a rand() in a function, how can i retrieve that random card 1-52?
so far i know that i have to find the length of the card. but i don't know why i have to save the location onto another variable and erase the card of the specified index before returning the card out the function.
int location = rand() % cards.size();
I don't know why i need to do this and how do i reinitialize the variable cards into another variable?
View 3 Replies
View Related