i want to develop one application in VC++ MFC ,which can insert & retrive data from a database(oracle), through a dll .The Dll is resposible for handling all database operation.
can any please help to work on that...
"EXE" + "DLL" + "DB"
1.how can i make a connection string for oracle database which is in remote system.
2.how can i handle DB opeartion in Dll.
i try with Dll , but it through error
send reply ,,,early
Try again and again,
At last you will say
I don't know the meaning for impossible.,.
in the Dll file when i try to open DB using the below function it work but
when i try to open the recordset open i.e.,rsOpen() , it open a DataSource dialog screen will opened ,instead of executing a sql query
bool CDaoDB::dbOpen(CString strFilePathName)
db = new CDaoDatabase(NULL);
db = NULL;
i am working on MDI application using mfc, the user can have new file in the regular way, or by using a wizard. i have no problem in the regular way since the document , the view and the framework are attached to each other in the initinstance method in the application.
the problem is in the wizard way.
in the wizard i have to set the child frame hidden, and attach the document to the wizard, and to destroy the document after finishing the wizard.
first thanks alot for your reply
actually in the finish page of the wizard i give the user the choice to end the document and save the results in a file, or to open the view to show him the data he already chose in the wizard to enable him to update them.
i also need to know how to hide the child frame, and how to associate the new document with the wizard
So let me get it straight :-
So the view should come ony when he does a finish in the wizard and that to depending on the checkbox valueand I also assume that the wizard mode only gets enabled after the first document is created .
if yes then you shouldnt take the pain to destroy the document since
OnFileNew() will destroy the prev document(and it should be called in the wizard finish) if any present and if the user preses cancel in between the wizard mode you can show the previous view.
So the problem comes were will you store the data during that process ,
I would suggest you to make an CContainer class which will hold the data and will stay in the App and in the finish after the document is created you set the container to the document and which will be deleted in its destructor .
I want to use excel for displaying graph. I refer MSDN artical "Use MFC to Create a Microsoft Excel Chart (Q178783)". It almost satisfy my need. But it display the chart in same sheet in which values for drawing graph is. I want to display the graph in another chart. Simply stating in sheet1 I want value for plotting graph and in chart1 I want the graph of it.
I tried for it hard but faailed to do it can anyone help me out.
for (x = strlen(fileName) - 1; x > 0; x--)<br />
// 01234567890123<br />
// screenshot.png<br />
/* If a period was found */<br />
if (fileName[x] == '.')<br />
/* Set it to the name without the extension */<br />
newName = malloc(x-1);<br />
strcat(newName, fileName);<br />
return newName;<br />
printf("%c", fileName[x]);<br />
That code, seems like it'll work if I modify other parts a little bit, but that else statement is not needed anymore... But if I remove it, compile, and run the program, I get a Windows error:
Title: mythax.exe - Application Error<br />
The instruction at "0x7c93426d" referenced memory at "0x00000000". The memory could not be "read".<br />
Click on OK to terminate the program<br />
Click on CANCEL to debug the program
Is this a bug in the compiler or something? I'm using MinGW 3.4.2... Thanks!
What are you trying to do there ? Your newName string is not initialized (so it contains garbage) and you try to append data to it (which is also larger than the newName array). So you write outside the bounds of your array.
To use strcat, your destination string needs to be zero terminated and is not secure:
Security Note Because strcat does not check for sufficient space in strDestination before appending strSource, it is a potential cause of buffer overruns. Consider using strncat instead.
Your program seems to have problems not connected with else. First of all, you try to execute strcat, witch concatenates two strings, but you first string -- allocated with malloc -- actually does not contains a valid value. Probably, more appropriate here is strcpy.
It seems that your problem is to determine the file’s name without extension. In this case the size of the malloc-allocated buffer should be x, not x-1, because a space for last null character is required.
Also consider other solutions for your problem. For instance, for finding the dot, you can avoid your loop and use strrchr function. For breaking a path into components, you can use splitpath function.
I am doing network programming in MFC. Problem is that i am trying to send a buffer to server using send(...) function. But there is an error. When i use WSAGetLastError() to check error code, it gives error code 0. Please can anyone tell me where can problem lie.
Yah i just wanted to know that in which scenerio, 0 is returned. what can be problem? I went on msdn. There is a list of error codes. But they are lables not integer values. How can i determine this one.
After you obtained the error code with "DWORD error = WSAGetLastError();" and stopped the program at a breakpoint, you can see a textual description of the error by adding the following value to Watch panel or QuickWatch window: "error,hr".