|
Does you application contain or create a window. If yes, you can use Window Messaging to communicate between two application, just add common message id between two application, and related function in WndProc function for win32 application and between BEGIN_MESSAGE_MAP and END_MESSAGE_MAP for MFC application.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
there is no create window function in the win32 application. there is only messagebox().
modified on Friday, July 24, 2009 4:12 AM
|
|
|
|
|
You could send the win32 app a message and a message handler to it. There are several tutorials on IPC in CP, just take a look at those.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Rajesh R Subramanian wrote: How hard is it to add MFC support to the console application and send a message to it so that it reads the new file again in response to the message
Can't u send message to Win32 application ?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Not if it is a console application.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Rajesh R Subramanian wrote: Not if it is a console application.
Humm... we can send window message to container window then
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Sorry if my comment hurt. That’s not intentional.. i think you felt bad.. my apology!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
I don't see what's there in your post to hurt me. I also don't know why do you felt that I was hurt.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Can Someone help I am not sure whats wrong.
I am getting the following debug message:
First-chance exception at 0x5d0c373e in Capture Data.exe: 0xC0000005: Access violation writing location 0x0043454c.
However on exit I get:
The program '[1284] Capture Data.exe: Native' has exited with code 0 (0x0).
Here is the code I have used:
BOOL CCaptureDataApp::InitInstance()
{
InitCommonControls();
CWinApp::InitInstance();
CCaptureDataSheet sheet("My Very Own Property Sheet App",NULL,0);
sheet.m_psh.dwFlags |= PSH_NOAPPLYNOW;
m_pMainWnd=&sheet;
INT_PTR nResponse=sheet.DoModal();
return FALSE;
In the Capture Data Sheet
IMPLEMENT_DYNAMIC(CCaptureDataSheet, CPropertySheet)
CCaptureDataSheet::CCaptureDataSheet(UINT nIDCaption, CWnd* pParentWnd, UINT iSelectPage)
:CPropertySheet(nIDCaption, pParentWnd, iSelectPage)
{
AddPage(&m_Page01);
AddPage(&m_Page02);
}
CCaptureDataSheet::CCaptureDataSheet(LPCTSTR pszCaption, CWnd* pParentWnd, UINT iSelectPage)
:CPropertySheet(pszCaption, pParentWnd, iSelectPage)
{
AddPage(&m_Page01);
AddPage(&m_Page02);
}
CCaptureDataSheet::~CCaptureDataSheet()
{
}
BOOL CCaptureDataSheet::OnInitDialog()
{
BOOL bResult = CPropertySheet::OnInitDialog();
}
|
|
|
|
|
I don't know why you get that exception but try turning on "Break into debugger on exceptions" in Visual Studio, it might show you where exactly the exception gets thrown. (In VS2003 it's under Debug->Exceptions in the menu)
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
This is where i am stuck in the debgugger. Not sure whats happening?
BOOL AFXAPI AfxDeactivateActCtx(DWORD dwFlags, ULONG_PTR ulCookie)
{
BOOL rc = pfnDeactivateActCtx != 0 ? pfnDeactivateActCtx(dwFlags, ulCookie) : FALSE;
return rc;
}
Why would it exit with a 0 if I haven't changed anything else in the code?
Would it not give me a memory leak or something?
|
|
|
|
|
|
Don't know but i doubt it.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
I am sorry I am not trying to be a pain. This is frustratung me...
Here is what I did...Any suggetions...
On a different machine i went down in versions..from 2008-2005-and finally to VStudio 6.
I used the same steps in all ..I got the same exception error except in Vstudio 6..Where I got no exception error...Imported the same project into my Visual Studio 2008 and it works fine...No First-chance error.
I am not sure what to do?...Well for now I can work with this imported project...but is this really a solution?...I have come to the end of the rope on this one...If I did something wrong, would VStudio 6 not complain as well?
Do you think you can advice me as what to do? I don't like to give up, at the sametime I don't want to be hitting my head if it is a bug in VStudio 2008?
I can't see me to be the only one trying or using the property sheet based application?
Thanks, I will really appreciate some sort of feed back, I am new at this and it's frustrating me..Please advice.
|
|
|
|
|
Is it possible that maybe all your project needed was a complete rebuild?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
I did 3 different projects and with all I did a rebuild..
thinking of the same thing?
|
|
|
|
|
Yes, i am just clueless how importing the very same project from 6.0 would solve your problem...
So you say the exception is thrown from AfxDeactivateActCtx? I supose that the pfnDeactivateActCtx pointer is pointing at something it shouldn't be. Can you maybe try to track down where this gets a value assigned? Maybe whatever it is pointing at gets destroyed somewhere and then the pointer is not NULL-ed out...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
I am getting it in disassembly.
|
|
|
|
|
Check your callstack untill you see something familiar, otherwise i am out of ideas and without actually seeing this happen i doubt i can do anything to help, sorry . Maybe someone else has a good idea...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
I don't know how to set some text in status bar at first application launch because always show "Ready" message ... I mention that my application is SDI but I think that applied on MDI too .I try to do that in twoo way : in CMainFrame::OnCreate : SetMessageText("My message") with no result and m_wndStatusBar.SetPaneText(0,"My message") but in vain. Can you help me ? Thank you.
|
|
|
|
|
Is it possible to declare member variable of class as a const, if yes,please give me 1 example how to initialize it and if not, why?
|
|
|
|
|
Yes, it is possible. You have to initialize it in the constructor initialization list:
MyClass::MyClass() : myConstInt(5)
{
}
You can also initialize it in the header file too, when declaring it:
class MyClass
{
const int myConstInt = 5;
}
|
|
|
|
|
This is working fine
MyClass::MyClass() : myConstInt(5)
{
}
but it is not possible,
class MyClass
{
const int myConstInt = 5;
}
compiler is giving error,
So I guess only one way to initialize const in a class..
|
|
|
|
|
Ooops, my bad. I don't use that notation very often. I thought it was ok but it is only valid if the member is static also.
|
|
|
|
|
sam_psycho wrote: Is it possible to declare member variable of class as a const,
Yes.
sam_psycho wrote: if yes,please give me 1 example how to initialize it
class A
{
static const int c = 299792458;
const int a;
A():a(5){}
};
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]
|
|
|
|