|
the file ist called setupapi.log and should be located in the windows directory.
Don't try it, just do it!
|
|
|
|
|
Hi
What are the advantages/disadvantages of using #define or pany precompiler directives?
Thanks in adavnce
Ram
|
|
|
|
|
The precomiler is both a blessing and a curse. It can really help you work round obstacles, but it can often have problems with compatibility with other compilers.
The main statments like #define, #ifdef, #ifndef, #endif and so on will work on any compiler. Others like #pragma once will only work on MSVC.
#define is useful in defining constants, and in activating and deactivating sections of code. However if you plan to use #define for constants, it's always better to use a global C constant instead:
const unsigned int MyValue = 100; Because the syntax checker can dig you out of problems this way. Also, try and avoid macros - use inline functions instead because again you may end up with crazy inexplicable compiler errors.
Joel Holdsworth
|
|
|
|
|
The main advantage is with proper use of the precompiler directives you can win the Internation Obfuscated C code contest
The other time you will see it is in header files, to make sure that the header isn't accidently included twice. The rule is if there is a way to do what you want without using the precompiler do it, but sometimes you don't have a choice.
If you don't know what the IOCCC is, check it out when you are prepared to be confused. Good programs will enjoy it, for the joke, the chance to learn some really stupid code, and to test the knowledge of C.
|
|
|
|
|
How to Create Process on remote server?
VikramS
|
|
|
|
|
|
To Hello,
I have a expansion card which has a connection to interrupt 15 pin of the PC.
How do I use VC++ 6.0 to detect the interrupt and do the necessary processing?
Is there any examples or articles that I can refer to?
Thanks.
S1189216G
|
|
|
|
|
Hi,
Use SDK coming with your card.
Otherwise, you should write own Windows driver using DDK.
Windows API doesn't allow working with the interruptes directly.
Sincerely Yours,
RadioShark
|
|
|
|
|
To RadioShark,
Thanks for your reply.
Any examples, links or article that I can go to?
Can I use C code interrupt handler?
If yes, how should be done?
S1189216G
|
|
|
|
|
Working with the interruptes and IOports directly is allowed in MSDOS. So, you can use C or C++ for MSDOS.
In MS Windows, you should write own driver. You will find the examples of driver in DDK.
Sincerely Yours,
RadioShark
|
|
|
|
|
Hi All
does ne1 know how to programatically change the title of an application
when i say title i mean, whats in the blue bar at the top of your app
thanks
si
|
|
|
|
|
If you are talking MFC then use: CMainFrame::OnUpdateFrameTitle()
Neville Franks, Author of ED for Windows www.getsoft.com and coming soon: Surfulater www.surfulater.com
|
|
|
|
|
You can use SetWindowText()
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
Antony M Kancidrowski wrote:
You can use SetWindowText()
This gets overwritten by MFC for the app title bar. See my reply.
Neville Franks, Author of ED for Windows www.getsoft.com and coming soon: Surfulater www.surfulater.com
|
|
|
|
|
Whoops, yes it does, sorry!
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
Hi all,
I have a service that handles SERVICE_CONTROL_SHUTDOWN so it is notified of the shutdown in progess. I need to distinguish between a restart and a shutdown. Is there a way to do so?
Thanx in advance.
Best regards,
Andrea
|
|
|
|
|
Look at the WM_QUERYENDSESSION and WM_ENDSESSION messages.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
There is a application with multiple document support(A document is associated with a few kind of views and managed by CMultiDocTemplate).If i open a new document and then close it for many times, i can’t open any window finally, even opening a pop-up menu in another process is unavailable. I think it due to the following code.But i don't know why it works well at the beginning. Is there a resource leakage?
Thanks for your help!
<br />
void CMultiDocTemplate::LoadTemplate()<br />
{<br />
CDocTemplate::LoadTemplate();<br />
<br />
if (m_nIDResource != 0 && m_hMenuShared == NULL)<br />
{<br />
HINSTANCE hInst = AfxFindResourceHandle(<br />
MAKEINTRESOURCE(m_nIDResource), RT_MENU);<br />
m_hMenuShared = ::LoadMenu(hInst, MAKEINTRESOURCE(m_nIDResource));
m_hAccelTable =<br />
::LoadAccelerators(hInst, MAKEINTRESOURCE(m_nIDResource));<br />
}<br />
<br />
#ifdef _DEBUG<br />
if (m_hMenuShared == NULL)<br />
TRACE1("Warning: no shared menu for document template #%d.\n",<br />
m_nIDResource);<br />
#endif //_DEBUG<br />
}<br />
|
|
|
|
|
1814 The specified resource name cannot be found in the image file.
ERROR_RESOURCE_NAME_NOT_FOUND
Carl
|
|
|
|
|
Thanks for your help!
Yeah, Code 1814 means can't find the resource in the image file, but in fact the function "LoadMenu" works well at the beginnig. The question is that it doesn't work after many openning and closing document operation. Does this problem due to resource leakage?
|
|
|
|
|
Waiting for your help!Thanks!
|
|
|
|
|
YunYan wrote:
HINSTANCE hInst = AfxFindResourceHandle(MAKEINTRESOURCE(m_nIDResource), RT_MENU);
Does hInst have a non-NULL value prior to calling LoadMenu() ?
YunYan wrote:
m_hMenuShared = ::LoadMenu(hInst, MAKEINTRESOURCE(m_nIDResource));
m_hAccelTable = ::LoadAccelerators(hInst, MAKEINTRESOURCE(m_nIDResource));
Do you also have corresponding calls to DestroyMenu() and DestroyAcceleratorTable() .
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I'm using rundll32 to run a dll that has no need for a main app. However i need to trap when windows is being shut down to serialize data. In the past i've used WM_QUERYENDSESSION in the main win proc.
Is there a way of trapping this message from a dll?
How else could this be acheived?
Thanks
Carl
|
|
|
|
|
when i programaticaly press button by
SetState(TRUE)
and user leaves it using tab-key
button executes command (the same action like button press by user)
-> how to avoid this call? (i need this command when user clicks on button only (or uses keyboard to press it))
thanks for reply
t!
|
|
|
|
|
Hello,
I'm writing a C# application using managed and unmanged c++ libraries.
I have a bug, which causes an assertion "_BLOCK_TYPE_IS_VALID".
The message appears always in a different places.
Exceptions handling is not helping. Where to look?
|
|
|
|