|
I am a new student of Visual C++ programming. I have difficulty in message handling in Dll. I have made some program which uses WM_messages to notify the main program for some specific event. I had no problem with developing windows exe as in windows I can specify message handler function along with specifying which window should receive the message. but how to specify window to receive message in a dll program which has to run in back ground without any windows.
Regards
|
|
|
|
|
smzhaq wrote: but how to specify window to receive message in a dll program which has to run in back ground without any windows.
Dll's doesn't runs in background. It loads and unloads.
You probably can do some reading of Dll[^] section on CP.
You may need to export some functions from dll to communicate with it.
Prasad
MS MVP - VC++
|
|
|
|
|
Thank you very much Sir. My prolem is that I do not need to have any User interface like dialog or otherwise for the task performed byt the Dll. It is related to speech recognition using miscrosoft Speech SDK. There is a function SetNotifyWindowMessage(hWnd,WM_MESSAGE,WPARAM,LPARAM) to specify which window (hWnd) will receive the message sent by events. Can you please tell me how to handle it in Dll. I mean what to do for argument Hwnd.
Thank you very much
|
|
|
|
|
Hi,
My requirement is to find font file name. Not from registry any other method i need.
Thanks in advance!
Murali.M
Have A Nice Day!
Murali.M
|
|
|
|
|
Use SHGetFolderPath(hWnd, CSIDL_FONTS, ...) .
"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 created a Visualization plugin for WMP but when i was developing it i also created a different visualization using the same project files. Both these plugins are now finished and different but they overwrite each other when they are registered via regsvr32.exe.
Im sure there must be some small bit of code within the dll that i can change to stop this?
Any Ideas?
|
|
|
|
|
You probably kept the GUIDs the same in the two projects, so when COM registration happens, they write to the same reg keys. Change all the GUIDs in one of the projects.
|
|
|
|
|
I want to get the output of the console.using the pipe i can get most of them.
but a console use multithreads i cannot get the threads output,
so can anybody tell me what to do!!
|
|
|
|
|
linsion wrote: I want to get the output of the console.
Did you create the console window via CreateProcess() or ShellExecute() ?
"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 used CreateProces
or maybe the threads return too fast the app cannot capture them?
|
|
|
|
|
linsion wrote:
i used CreateProces
Then see here and here.
linsion wrote: or maybe the threads return too fast the app cannot capture them?
You should not need to be concerned with how slow/fast a thread executes. That's the whole paradigm behind asynchronous code.
"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
|
|
|
|
|
thanks for your help!
but the method your show me didnt work.
i have to give it up;
another question,when i connect to a remote computer(using nc),my console change,and this time i cannot input commands through the pipe.
how to solve this?
|
|
|
|
|
How can we use web parts as in like >> have a look at this site
http://www.pageflakes.com (asp.net 2.0 )
Please Help
|
|
|
|
|
i have made a sdi application, in that i have made a class derived from CForm view named CHttp.
Now from my main application class i have called a function which is inside CHttp
by simply making a object like this
CHttp test_http;
using this object i have called a function which is inside CHttp class
test_http.StartPingThread(URL_Name,nIndex);
void CHttp::StartPingThread(CString ping_url,int ping_index)
{
CWnd *obj_t = this;
th_run = 0;
error_ping_url = ping_url;
assocsping[ping_index] = (CPingThread*) AfxBeginThread(RUNTIME_CLASS(CPingThread),
THREAD_PRIORITY_NORMAL,
NULL,
CREATE_SUSPENDED,
NULL);
assocsping[ping_index]->ping_str = ping_url;
assocsping[ping_index]->ping_int = ping_index;
assocsping[ping_index]->ping_bool = TRUE;
assocsping[ping_index]->ResumeThread();
if(assocsping[ping_index])
{
m_PingThreadList.Add(pingThread);
assocsping[ping_index]->SetLogWindow(this);
assocsping[ping_index]->ResumeThread();
}
}
now in second last line it is not passing any value in this
ie. passing null
how to pass handle of a window in this function....
thanks in advance
|
|
|
|
|
this->GetSafeHwnd() returns you the handle to the current window
You mean this?
|
|
|
|
|
When i m not getting any value in this then how will GetSafeWnd() function will return anything..
|
|
|
|
|
When i m not getting any value in this then how will GetSafeWnd() function will return anything..
Is your function static?
If not, this has a value, as you have callted the function you are in on this. I.E> as if you had written
this->Function();
Failure is not an option - it's built right in.
|
|
|
|
|
Right,
If you are inside an object and "this" is corrupt, you have a big problem.
You did already verify if the constructor is correctly executed?
If you create a view without templates, you need to create the object, then execute Create(...),
to create the window and following a OnInitialUpdate.
Then your view is correctly created and initialized.
But even not to create and initialize the window, the "this"-pointer should have a value
|
|
|
|
|
neha.agarwal27 wrote: assocsping[ping_index]->SetLogWindow(this);
At this statement, what is the value of the this pointer? Perhaps you meant to use AfxGetMainWnd() instead.
"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
|
|
|
|
|
Hi everybody,
i create a ContextMenu myself via AppendMenu(...);
The string is for example "List customers"
So i can choose the "List customers" via the contextmenu or via Key F2;
If i wish to add a Accelerator Key ( which is ONLY for this view )
I catch the KeyDown Message and if it's the F2 Key i open the window.
Now i like to display the menu in this way "List customers F2" with a tabulator between the
string and F2 ( that other menu-items displays the corresponding key in one "column" )
"List customers\tF2" doesn't work.
Has someone an idea?
Thanks
|
|
|
|
|
Can somebody help in for ..
i have an MDI Application. In that if i open one Document and then close it (from the close of tht specific document's frame window)will ask me to save the file(As i had made this by calling setmodifiedflag(true)) . But when i tried to directly close the mainframe window application ask me save two times . In this case the Destroy window of the frame window (opened document )gets called twice ..
and due to this my application get asserted ...
Thanks for your time ...
|
|
|
|
|
Hi
To start VC++ from scratch what is the best way?? or What is the best way to read VC++?? What topics must be started first
|
|
|
|
|
You can start reading Charles Petzold, MSDN etc. You should be aware about threading, messages etc. It's not that you would be able to grab all VC++ in one go. Once you start developing some code you would really need some help from Pro's (there are lot's of them on CodeProject ). With the confidence factor increasing you can make a move to MFC, ATL, COM and other relevant topics and read books like Inside COM, Beginning ATL etc.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
I think see www.cplusplus will be helpful for you.
|
|
|
|
|
Hi
Without using VC++ editor how to run the VC++ program in command prompt by writing the program in notepad.
Regards
Kranthi.
|
|
|
|