|
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
|
|
|
|
|
This was supposed to be a reply to the question below. Sorry.
|
|
|
|
|
There are many softwares will auto run when the Windows only startup!
So,I want to code a small program to turn off some software's autorun?
How should I do this task?Thanks.
GOOD LUCK.
|
|
|
|
|
Depending on the new entry of the software at the time of installation, some softwares add an entry in the Run folder in the Registry. If you know how to tweak the registry and modify the values so as not to run the software you know how to stop a software from executing at StartUP. Playing with the registry is dangerous and you should always have a backup of it before doing any changes.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
But if I do not only do such task. For example,when I insert an USB device,a special software will launch,that's also should be turned off.How to reslove such new task?
Thanks
|
|
|
|
|
Programs can be started on 3 levels
1. In the starup folder of the user.
These are link files which can be deleted. I think you can find the folder with the function SHGetKnownFolderPath[^]
2. There are 2 places where programs can be starten from the registry
HKCU/SOFTWARE/MICROSOFT/WINDOWS/CURRENTVERSION/RUN
HKLM/SOFTWARE/MICROSOFT/WINDOWS/CURRENTVERSION/RUN
3. Last place: The services.
These program2/services can be started according to there startup settings: manual, automatic, disabled.
Hope this is helpfull
codito ergo sum
|
|
|
|
|
But if I do not only do such task. For example,when I insert an USB device,a special software will launch,that's also should be turned off.How to reslove such new task?
Thank you.
|
|
|
|
|
There are loads of autorun places - Have a look at the AutoRuns utility on www.sysinternals.com.
If you mean a specific program, and you know how *it* autostarts, then it should be simple. For the more general case? Harder.
Iain.
|
|
|
|
|
Yes,I know which program I want to turn off its auto run.
Thanks.But if I do not only do such task. For example,when I insert an USB device,a special software will launch,that's also should be turned off.How to reslove such new task?
|
|
|
|
|
kcynic wrote: But if I do not only do such task.
You said this three times and it still makes no sense. Do you or do you not know how to remove a value from the HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run key?
kcynic wrote: ...when I insert an USB device,a special software will launch,that's also should be turned off.
This has nothing to do with the aforementioned key. Likely, some service is running that is monitoring all USB activity. Does the USB device have any programs on it that could be auto-running?
"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
|
|
|
|
|
Yes,I can see a service running now.
Thank you very.
Happy Mid-auturmn Day
|
|
|
|
|
|
Dont need to ask again you can complete your question.
|
|
|
|
|
thanks sir for ur response
i know ip address sir
but to connect with other system from my system
i need also port number and i read about port numbers but i dont understand
that which port number is user to connect two systems in the network
thanks
|
|
|
|