|
yes, i m using CAsyncSocket class and its all in one thread, however, i m thinking of putting my 'parsing functions' for six OnReceive()s in six seperate threads. I hope thats fine.OnReceive1(),OnReceive2(),...OnReceive6() would all be in the same thread.
As for connecting to the database i m using GetDefaultConnect() and GetDefaultSQL() methods(Created by default in the project for MFC Application using Database)
|
|
|
|
|
Hi all,
Please some one help, how to run an exe file at runtime using VC++.NET. I am new to this environment. In c# using system.diago.......... it's possible to execute an exe file at runtime. But i dnt knw in VC++. Plz help me.
Thanks in advance
Know is Drop, Unknown is Ocean
|
|
|
|
|
ShellExecute(/*parameters*/);
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Thanks for your help. Plz give me some sample code to understand
I tried the below code:
MessageBox(NULL, "Before!", "Invalid Key", MB_OK | MB_ICONINFORMATION);
HINSTANCE hInst = ShellExecute(NULL,"Open","C:\\Winnt\\Notepad.exe","C:\\xxx.txt","",SW_MAXIMIZE);
MessageBox(NULL, "After!", "Invalid Key", MB_OK | MB_ICONINFORMATION);
For me the both Message boxes are displayed, but not the exe was not opening.
Plz help me
-- modified at 6:03 Monday 24th September, 2007
Know is Drop, Unknown is Ocean
|
|
|
|
|
|
Thanks for your help. Plz give me some sample code to understand
Know is Drop, Unknown is Ocean
|
|
|
|
|
Search Visual C++ / MFC forum with keyword ShellExecute and you will get plenty of examples
|
|
|
|
|
Thanks for your help.
I tried the below code:
MessageBox(NULL, "Before!", "Invalid Key", MB_OK | MB_ICONINFORMATION);
HINSTANCE hInst = ShellExecute(NULL,"Open","C:\\Winnt\\Notepad.exe","C:\\xxx.txt","",SW_MAXIMIZE);
MessageBox(NULL, "After!", "Invalid Key", MB_OK | MB_ICONINFORMATION);
For me the both Message boxes are displayed, but not the exe was not opening.
Plz help me
Know is Drop, Unknown is Ocean
|
|
|
|
|
ShellExecute(NULL,"Open","C:\\Winnt\\Notepad.exe","C:\\xxx.txt",NULL,SW_MAXIMIZE);
|
|
|
|
|
Thousands of thanks for your kind help, finally me suggest me how to pass an string as argument to that exe.
Thanks for your suggetions
-- modified at 6:32 Monday 24th September, 2007
Know is Drop, Unknown is Ocean
|
|
|
|
|
Exelioindia wrote: ...suggest me how to pass an string as argument to that exe.
That's what the fourth argument (e.g., c:\xxx.txt) is for.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
You can also use CreateProcess() .
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I have a try-catch block as follows
try
{
A();
}
catch(...)
{
}
When i was working with Visual C++ 6.0, any null pointer accessed within function A was caught by the above catch. But now after VS2005 conversion, the same catch doesn't handles null pointer access, and the program crashes.
Please suggest on the Project Setting to be changed for this to work.
|
|
|
|
|
Usually YOU have to check if the pointer is valid:
if(p!=NULL){
...
p->...
...
}
in this case you also can:
try{
if(p==NULL) AfxThrowMemoryException();
....
p->...
...
}catch(...){
}
hope helps
Russell
|
|
|
|
|
From MSDN :
Also, in Visual C++ 2005, all objects in scope when the asynchronous exception is generated will not be destroyed even if the asynchronous exception is handled. Under /EHs, catch(...) will only catch C++ exceptions. Access violations and System.Exception exceptions will not be caught.
Resolution :
You can use Yes With SEH Exceptions (/EHa) option.
To set this option -
Click the C/C++ folder.
Click the Code Generation property page.
Modify the Enable C++ Exceptions property
-- modified at 5:41 Monday 24th September, 2007
|
|
|
|
|
ah you beat me to it
|
|
|
|
|
Hi,
I have a little Problem with a CFormView derived class. I am now using the CChildFrame to determine the size of the window by creating a new View dinamically. It works good, but now I have a little problem.
The new CFormView I'm adding has a lot of controls (All CEdits) with writing protection to give some information. The number of CEdits can be [1, 24] (both inclusive). I want to make the view-frame to have just the needed size and here comes the problem.
The frame is resized as I want to the size that has to be shown. But the surface of the CFormView is keeping the size it has in the resource editor (as the needed elements were 24), so scrollbars appear although the elements in the non visible area are hidden with ShowWindow (FALSE);
So, the question is... how can I change the size of the formular to adjust it to the size of the frame? I don't want my visible controls to be affected (compressed or something like that). Just the opposite of ResizeParentToFit (...) that makes changes in the frame to fit the view, but avoiding effects like SetScaleToFit (...) because the controls change the size.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
I have "solved" the problem by using MoveWindow (...)
But the solution has been... to put the size in MoveWindow to size of frame + size of scrollbar. So the scrollbars are not visible anymore, and they doesn't affect my controls in any way.
But I would still prefer to do it correctly, this is just a trick (isn't it?) but works :P
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
i am trying to show MPG,AVI MOV files in media player but i am getting visual C++ fatal error c1083: cannot open include file 'd3d9.h' etc.
|
|
|
|
|
This is a directX header file. Did you install the DirectX SDK ?
|
|
|
|
|
asdfkhjgk wrote: ...cannot open include file 'd3d9.h'
Do you have this file?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
It seems you dont have this file on your system but I suggest see MCI functions for play MPG and avi for Mov I dont know they can show it or no.
|
|
|
|
|
In "ShellExecute" function the parameters we pass it to it is,
HINSTANCE ShellExecute(
HWND hwnd,
LPCTSTR lpOperation,
LPCTSTR lpFile,
LPCTSTR lpParameters,
LPCTSTR lpDirectory,
INT nShowCmd
);
in this "LPCTSTR lpParameters" is a post parameter or something else? can we pass post parameter through "ShellExecute" function?
Anay
|
|
|
|
|
Did you read the doc?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->ßRÅhmmÃ<-·´¯`·.
|
|
|
|
|
Use that member for any command line arguments you wish to pass onto the exe.
Waldermort
|
|
|
|