|
The EXE is just to lunch the DLL , that is all
The dll is a MFC SDI application contains a main window that do all work.
And to lunch this DLL i need this EXE.
So if there is a solution to this situation please help.
|
|
|
|
|
Ok, i understand that, but without knowing some details about what you tried to do i can only guess...
So what i would first try is to simple load the DLL ( LoadLibrary ), and have an exported method -as i mentioned earlier- that brings up the windows and runs the message loop, localize this method (GetProcAddress), call it and let it run until it is done (the user dismisses the window, selects Exit from its menu, whatever...), and then exit. The EXE would sit in memory while the DLL's function is executed but i personally wouldn't care much. For the EXE i'd probably create a DIALOG BASED app in VS, remove the dialog and everything else that gets generated automatically by the app wizard, and in the applications's InitInstance i'd do the loading and executing and then return FALSE from it to exit. Or you could create a barebone project and do about the same just without any app class and the rest...it's up to you.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
It's a simple problem. He wants to launch an application (exe). The application then calls a function in a dll (e.g. ShowMyWindow()) and immediately terminates. But he wants the dll function to continue to run.
Absolutely impossible, and totally stupid.
|
|
|
|
|
I read your posts but i am not absolutely convinced that he wants the exe to literally terminate, he just doesn't want to see it is there, not sure but i think he doesn't mean by that that the exe shouldn't be listed in task manager for example, he just doesn't want to see it on his desktop. But of course i might be wrong, if he really wants the exe to terminate that is indeed problematic...he could try to inject the dll into -i don't know- explorer.exe, start a thread and let it run there, but there has to be a better solution...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
Code-o-mat wrote: I read your posts but i am not absolutely convinced that he wants the exe to literally terminate
I agree the description is not overly clear.
Code-o-mat wrote: but there has to be a better solution...
Yes, he could study windows programming and learn what a dll is for.
|
|
|
|
|
khaliloenit wrote: What i need is to make a program (.exe) to execute this dll and it will be invisible because i need it to be like a Trigger just call and leave and let the dll working i.e the GUI of the dll still for me.
This sounds back to front to me, assuming I understand the question. The exe file is the application that should be doing most of the work, while the dll portion supplies extra functions that are called on request. In any case you cannot leave a dll function running after the caller (exe) terminates. You may need to review your design.
|
|
|
|
|
- It is the DLL which should do all work
- the EXE should call the DLL which is a graphic interface
- the EXE call an exported function from the DLL only
- when i exit from the DLL all work is finished.
i hope that i explained more my situation.
|
|
|
|
|
khaliloenit wrote: i hope that i explained more my situation.
Yes, so what is your problem?
|
|
|
|
|
I recapitulate all problem with:
i will have two files :
- EXE : just lunch the DLL and disappear
- DLL : called with its exported function (it is done) and it has the style of window and will do all work
and when i quit this window(exit from DD) is weening that my all application exit
the problem is when i lunch the EXE file my window(the DLL) appears and disappears quickly and i need it to stay until i exit from it !
So how can i do this ?
can i use a console application which lunch the DLL and still waiting? or there is an other solution
|
|
|
|
|
khaliloenit wrote: the problem is when i lunch the EXE file my window(the DLL) appears and disappears quickly and i need it to stay until i exit from it !
As I said in my previous reply, you are doing this the wrong way round. The main work of any application is done in the exe file not the dll. You cannot leave a dll running after the exe terminates; it makes no sense to do things this way.
|
|
|
|
|
khaliloenit wrote: What i need is to make a program (.exe) to execute this dll...and leave and let the dll working...
Not possible, otherwise DLLs could just start by themselves.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
hi,
i am working with window service. and i am able to show my application UI from service by using CreateProcessAsUser() but is it possible to send message from service to my application.
thanks
|
|
|
|
|
_T("No name") wrote: but is it possible to send message from service to my application
Why not?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Remember that on Vista/Win7 then services are running in their own session. When starting the UI application then it must be running in the user-session.
Have feeling that it is better that it is user that starts the UI application (Maybe as a process started at user-login). The UI can then contact the service through whatever communication form you like. Namedpipes might be a good way.
|
|
|
|
|
thanks i will read about pipes then.
|
|
|
|
|
Hi all,
i m using CReportCtrl class from codeproject in ListCtrl.
from this article
Another Report List Control[^]
when i m using a worker thread to fill the values in List.its crash.
please help me how can i do this.
thanks in advane.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
"_$h@nky_" wrote: when i m using a worker thread to fill the values in List.its crash.
How does the worker thread fills the list (I hope it just sends meesages and leave the UI updating task to the UI thread...)?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
"_$h@nky_" wrote: when i m using a worker thread to fill the values in List.its crash.
No surprise there. The worker thread should not be interacting with any UI control that it does not own. It should use PostMessage() instead.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi All
I am trying to get excel used range.Here i am using this code for getting excel col and row.
Excel::RangePtr pRange = Psheet->UsedRange;
long row;
long col;
COleSafeArray sarect(pRange->GetValue());
sarect.GetUBound(1,&row);
sarect.GetUBound(2,&col);
It's working fine.but excel have data like this
WorkSheet1
A B C D E
1)
2) ID NAME ADDRESS
3)
4) ID NAME ADDRESS
5)
6)
7)
8) ID NAME ADDRESS
then i am getting row=7 and col=3.It's showing row=7 is right but column is not showing right.Because column use in excel is 5.So how can i get right row and column number.
Plz help me
|
|
|
|
|
Hello,
I had made an application which trapped WM_QUERYSESSION to block SHUTDOWN and LOGOFF in Windows XP. When Trying to port this solution on VISTA/WINDOWS 2008/Windows 7 I need to call additional methods namely ShutdownBlockReasonCreate() , ShutdownBlockReasonDestroy() which is defined in winuser.h for VISTA. After installing VS 2005 and upgrading it for windows VISTA by SP1 , I am still not getting ShutdownBlockReasonCreate () in windows vista winuser.h. Please let me know where am I doing things wrong .
Regards,
Kushagra
I hate coding but I luv to develop
|
|
|
|
|
In the *.cpp files where you call these functions paste somewhere at the beginning (but after #include stdafx.h ):
BOOL WINAPI ShutdownBlockReasonDestroy(
__in HWND hWnd
);
BOOL WINAPI ShutdownBlockReasonCreate(
__in HWND hWnd,
__in LPCWSTR pwszReason
);
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Download and install the latest Windows SDK from Windows SDK for Windows Server 2008 and .NET Framework 3.5[^].
Then run the Windows SDK Configuration Tool from Start -> All Programs -> Microsoft Windows SDK v6.1 -> Visual Studio Registration to integrate it with Visual Stdio.
«_Superman_»
I love work. It gives me something to do between weekends.
Microsoft MVP (Visual C++)
|
|
|
|
|
how to show grid on dialog in dialog based application as i want to write on this grid by using mouse in vc++,mfc
|
|
|
|
|
In order to fulfill your requirements, today are required the same basic tasks I pointed out yesterday [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
What about tomorrow?
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|