|
When i tried to load IDI_APPLICATION i have written
LoadIcon(hInstance,IDI_APPLICATION);
instead of LoadIcon(NULL,IDI_APPLICATION);
still it is working the same way ..
Any how thanks for the help.
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
I cannot confirm this.
In my tests, if hInstance is not null, then Windows tries to locate in my application an icon having the ID equal with IDI_APPLICATION (32512). Since I do not have it, the call fails and returns NULL . GetLastError returns "The specified resource type cannot be found".
If I define an icon with this ID, the image is loaded from my application.
Maybe in your application the hInstance variable simply was NULL ?
|
|
|
|
|
Hello,
I'm developing a NT Service, which at some times needs to load an MFC extension DLL, and execute some function.
The NT Service was created like a WIN32 console application, and It seems to work well.
The problem is that after the LoadLibrary, and GetProcAddress calls, and when everything seems to be ok, the actual call to the dll, is not returning...
I now that, since I've made some debug logs to the system event log, and the last entry was before calling the function within the dll; after that no more logs, even if the function should return rapidly!
Calls are made in a thread, separated from the service main thread.
Any suggestion is appreciated!
Thanks in advance for your time.
ALMC
|
|
|
|
|
Did you write the dll ? If yes, try to debug it to see what's happening. In complement of using logs, use your debugger also. It will provide much more info than a simple logger can do.
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
I have the dll source code. But I'm new to NT Services, and I haven't figured out how to debug services...
I'm using VC++ 6.0.
If I use the service "directly", not as "real" service, it works fine. No problems at all.
I have this question when I run the release version, as a real NT Service.
ALMC
|
|
|
|
|
almc wrote: m new to NT Services, and I haven't figured out how to debug services..
Debuging Services is not easy.. as they Run out of user account.. you have use old and Wise Debugging method like Logging, messagebox to determine flow of data!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Hi,
Can I use a single High-resolution Timer(multimedia) for multiple threads.If yes then Can anyone provide some tutorial link about that?
Best Regards.
Cyber Friend
|
|
|
|
|
Barring any further details, can you not just have the timer trigger an event or some other synchronization object, and let multiple threads act on that event being signaled?
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
Cyber Friend wrote: Can I use a single High-resolution Timer(multimedia) for multiple threads.
Not sure what you mean by this. Callbacks from multimedia timers are run in a separate thread already.
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
-- modified at 7:42 Wednesday 14th June, 2006
|
|
|
|
|
Hi,
Nemanja Trifunovic wrote: Not sure what you mean by this. Callbacks from multimedia timers are run in a separate thread already.
I have 4 threads in my application n each of them needs a timer for possibly different time interval. Can I use a single multimedia timer for them all. If yes then how?
Best regards.
Cyber Friend
-- modified at 8:22 Wednesday 14th June, 2006
|
|
|
|
|
Can't you just have each of the threads call SetTimer() ?
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi,
DavidCrow wrote: Can't you just have each of the threads call SetTimer()?
Isn't it a problem that all threads call SetTimer() at the same time.This means if I have 30 threads then I have to create 30 timers at the same time. Is this good for my application to consume so much windows resources.Currently I m creating 4 threads but in future I have to create round about 30 threads, all having separate timer intervals.
Regards.
Cyber Friend
|
|
|
|
|
Cyber Friend wrote: Isn't it a problem that all threads call SetTimer() at the same time.
Technically, they won't be. Since Windows is not a RTOS, each call to SetTimer() would be synchronous.
Cyber Friend wrote: Is this good for my application to consume so much windows resources.
Probably not.
What exactly are you trying to do? Maybe an alternative solution can be found.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi DavidCrow,
First of all Thanks for your reply.
DavidCrow wrote: What exactly are you trying to do? Maybe an alternative solution can be found.
The scenario in my application is that:
I have four threads in my application, each of which is listening to a port on a telephony card for incoming calls.When answering a call the thread plays an audio file and if user doesn't press a digit then thread waits for some timer interval to replay that file again. The thread has to replay that file after timer interval expires. And this timer interval may be different for each thread as each thread is running a differt script for telephony flow.
Hopefully You have understood my problem.
Best Regards.
Cyber Friend
|
|
|
|
|
At least I think you can manage to set various events at each timer step that will help synchronize multiple threads.
Don't know if this helps, and don't have an example. Sorry.
|
|
|
|
|
Hi,
I have created a wizard using property pager in vc++ mfc. I used the following to add a header.
CWizSheet pex("New Property Sheet");
pex.m_psh.dwFlags |= PSH_WIZARD97;
Please can you tell me
1)How do I add a bitmap to the header?
2)A background color/bitmap to the rest of the page?
3)How do I add the text to the header?
I have found many tutorial explaining how to create a wizard using property pages, but they do not explain how to add a header, bitmap and text to the header. Please help.
Thanks.
Tara
Fortitudine Vinsinues!
|
|
|
|
|
hi all
I have MFC application and a public method
void CProject::Something(CButtonDerivedClass bButton)
{
}
When in OnInitDialog I call this method, I get error :
...
Something(m_bDerivedButton);
...
error : Error 1 error C2248: 'CObject::CObject' : cannot access private member declared in class 'CObject' c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxwin.h 1814
Please help if you can.
thanks
-- modified at 6:47 Wednesday 14th June, 2006
|
|
|
|
|
At a guess, it looks like the compiler can't make a copy of your class. So, can you pass it as a pointer or reference ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Am also think the same. Need to pass the pointer or reference to the function.
Please tel ur result.
yours faithfully
ajeeshcv
|
|
|
|
|
HI,
HOW TO HANDLE WM_DISPLAYCHANGE MESSAGE
|
|
|
|
|
either check for this message in the WindProc
or add the following entry in message map
ON_MESSAGE( WM_DISPLAYCHANGE, OnDisplayChanged )
now add a new function with name and proto
LRESULT OnDisplayChanged( WPARAM wParam, LPARAM lParam )
nave
|
|
|
|
|
|
|
Can you be more specific
whitesky
|
|
|
|
|
Your post doesn't describe itself clearly. What problem are you having?
My guess : Probably you are writing to invalid memory location.
or you are using an invalid pointer somewhere
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|