|
Hello,
yes. Createprocess run another application .
Try WinExec function
With Regards,
R.Selvam
|
|
|
|
|
Yes, WinExec can do it. Thanx a lot.
|
|
|
|
|
While WinExec() might keep your MFC application from freezing, it would appear that you've simply masked the problem.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
That is true. I suspect that there is some memory leak in another application. Since it was written by somebody else, I am not going to fix it now
|
|
|
|
|
cchere wrote:
I suspect that there is some memory leak in another application.
You can always use the Performance monitor (MMC plug-in) to verify this.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Thanks Dave. You are so resourcefule. I will try MMC myself.
|
|
|
|
|
cchere wrote:
But CreateProcess is supposed to create an independent application. right?
What value(s) did you use for dwCreationFlags?
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
I use CREATE_NEW_CONSOLE|CREATE_DEFAULT_ERROR_MODE.
|
|
|
|
|
How can I calculate the new size of a picture
to be printed on the printable area of a page.
In another words, the same formula I am using to
display any size picture on the client area of
the program, does NOT work with the printer.
It almost does it, but always cut just a little bit
of the right side of the picture.
( Landscape ---- left to right )
|
|
|
|
|
Hi there,
I haven't got a huge amount of experience with DLLs so go easy on me.
I have a DLL which is working fine. I need to write a .exe which calls two of the DLL's methods.
The class declaration in the header file of the DLL looks like this:
class CFaCSMenuApp : public CWinApp<br />
{<br />
public:<br />
CFaCSMenuApp();<br />
__declspec(dllexport) void AttachFromImanage();<br />
DECLARE_MESSAGE_MAP()<br />
};
The .exe file looks like this:
class DllFire<br />
{<br />
public:<br />
__declspec(dllimport) void AttachFromImanage();<br />
DllFire();<br />
};<br />
<br />
int main()<br />
{<br />
DllFire df;<br />
df.AttachFromImanage();<br />
return 0;<br />
}
When I try to compile it I get the following output:
Compiling...
Test.cpp
Linking...
Test.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall DllFire::AttachFromImanage(void)" (__imp_?AttachFromImanage@DllFire@@QAEXXZ)
Test.obj : error LNK2001: unresolved external symbol "public: __thiscall DllFire::DllFire(void)" (??0DllFire@@QAE@XZ)
Debug/SIStarterCon.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
SIStarterCon.exe - 3 error(s), 0 warning(s)
What am I doing wrong here? I have put the .lib file created by the dll in the Object/Library modules section of the project settings.
Cheers, Ben
|
|
|
|
|
Well, calling dll from exe is straight forward if you use static linking. Just add .lib file name to the library link section of .exe settings. make sure when compiler links, it can find where .lib is located. Also, in the .exe source code you will need to add #include "yourdll.h" header file. Compiler must also know where is that .h file is located.
Hope that helps,
|
|
|
|
|
I'm trying to solve a puzzle, how to implement a timeline chart. I tried creating my own class with a list control and a slider control as members. But I can't get them to synch. Any ideas? Thanks in advance.
|
|
|
|
|
Does anybody know how to change the source url for a web service in VC++ without manually changing the generated proxy file from sproxy.exe?
There's no direct method and the TClient (CSoapSocketClientT) which holds the information is not accessible directly. I also tried to derive a new template from the generated one and thereby setting the TClient url, but the base class ignores it, and uses the info from the generated file.
It's starting to annoy me that I cannot change it, so any help will be appriciated
/Boris
|
|
|
|
|
...must be more tired than I thought when I didnt see the obvious
|
|
|
|
|
I posted this on another forum but I am hoping this forum will have some good suggestions.
I am trying to incorporate functionality into an application so that the user can hit the Minimize button on a window and the window will minimize to a particular size. I am trying to do this with the Minimize, Maximize, and Close buttons on the top right of the window (standard window functions). My problem is I am not sure how to do it. If the user resizes the window, I am preventing the window from going below a specific size. But is there any way to do the same thing when the minimize button is hit or I am forced to allow the window to be fully minimized?
This is not C++ or MFC, I am having to do this in an application that is written in C. Any suggestions?
|
|
|
|
|
Handle the WM_SYSCOMMAND message.
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
Has anyone figured out how to create a CFileDialog and
set its sort settings? I have read the numerous examples for
setting the filters, but can find no information of column sorting.
For example I want to bring up a CFileDialog
and show the files sorted by date.
What I would really like to do is get the settings that the user
last used and bring up the CFileDialog the same way the next time my application
creates one.
Thanks in advance to the most useful people on the WWW
|
|
|
|
|
MaxHacker wrote:
For example I want to bring up a CFileDialog
and show the files sorted by date.
So just click on the Modified column. Nothing special is needed.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Yes OK, but what I am REALLY looking for is a way for my application
to read from the CFileDialog what the user has sorted on, and pre sort it the next
time I display one so that the user does not have to do it each time.
|
|
|
|
|
You might try setting the value of m_ofn.lpfnHook and see if you get notified of a heading click.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
I have interfaces definitions.
I have implemented them in dll's
These dll's worked as cutom plugins. Usually they were build by msvc.
Each dll exported 3 function, GetIterfacesCLSIDS()/Create(CLSID)/Destroy(CLSID). It woked superb when both (client, plug in were buld by msvc compiler)
or both with mingw compiler.
The client now has growned and I'm using massive MFC (has lot's of gui and u knw is easy).
Now I try to build the dll's on demand (as compiled script)
and I use free gcc (g++) from (Mingw) C++ compiler and dlltool.
The dll is oj, and exported functions are called and my instances created ok.
Now I get 'ESP was not saved corectly durring a ... see the call type'
So is not the call type. As long the object imlementor of the interface is created my dll and the virtual table layout is different than the msvc.
Msvc vtable is
PObject->PVtable->[Vf1][Vf2]..[Vfk]
while
mingw vtable is
PObject->[Vf1][Vf2]..[Vfk]
So there is a missing intermdiare [PVtable] pointer there. Does any one know how to hack the calls using trunks or __asm (back and forward)
these ? Thanks
|
|
|
|
|
|
Sorry guyz...I ask another question to you.
Ok, I began studying some MFC programming with Jeff Prosise's "Programming Windows with MFC 2nd Ed." and I am blocked at the Hello World chapter.
I use his code:
HELLO.H
class CMyApp : public CWinApp
{
public:
virtual BOOL InitInstance ();
};
class CMainWindow : public CFrameWnd
{
public:
CMainWindow ();
protected:
afx_msg void OnPaint ();
DECLARE_MESSAGE_MAP ()
};
HELLO.CPP
#include <afxwin.h>
#include "Hello.h"
CMyApp myApp;
/////////////////////////////////////////////////////////////////////////
// CMyApp member functions
BOOL CMyApp::InitInstance ()
{
m_pMainWnd = new CMainWindow;
m_pMainWnd->ShowWindow (m_nCmdShow);
m_pMainWnd->UpdateWindow ();
return TRUE;
}
/////////////////////////////////////////////////////////////////////////
// CMainWindow message map and member functions
BEGIN_MESSAGE_MAP (CMainWindow, CFrameWnd)
ON_WM_PAINT ()
END_MESSAGE_MAP ()
CMainWindow::CMainWindow ()
{
Create (NULL, _T ("The Hello Application"));
}
void CMainWindow::OnPaint ()
{
CPaintDC dc (this);
CRect rect;
GetClientRect (&rect);
dc.DrawText (_T ("Hello, MFC"), -1, &rect,
DT_SINGLELINE ¦ DT_CENTER ¦ DT_VCENTER);
}
Now what I do? Simply, I create a new Win32 app, empty project and I create the two files; when I run the application I get two errors...
Compiling...
prova.cpp
Linking...
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex
Debug/prova.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
prova.exe - 3 error(s), 0 warning(s)
HELP ME! PLEASE!
Thanx boys!
Alberto from Italy.
|
|
|
|
|
Solution is simple:
In project properties select --> c++ --> code generation,
then in Run time library select Multi thread debug.
Cheers,
|
|
|
|
|