|
acerunner316 wrote: ...the only difference between standard and pro is the sql server.
Check out the differences between SQL Server Express Edition and SQL Server Developer (Enterprise) Edition. There are a bunch.
"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
|
|
|
|
|
|
Resolved, Thanks.
What are issues with these classes:
A.h
class A
{
class B
{
}
B m_b;
B* SomeFunc();
}
A.cpp
...
B* A::SomeFunc()
{
return &m_b;
}
...
-- modified at 13:00 Tuesday 14th August, 2007
// "Life is very short and is very fragile also." Yanni while (I'm_alive) { cout<<"I love programming."; }
|
|
|
|
|
Hamed Mosavi wrote: What are issues with these classes:
Issues such as: you don't end their declarations with semicolons?
|
|
|
|
|
No, thanks.
The problem resolved. I simplified a much more complex class to ask for help here, by doing so, I found the real problem that has nothing to do with this.
Anyway, thanks for your effort. A 5 is all I can do.
Thank you.
// "Life is very short and is very fragile also." Yanni while (I'm_alive) { cout<<"I love programming."; }
|
|
|
|
|
Hamed Mosavi wrote: What are issues with these classes:
Missing semi-colons, non-descriptive class names, missing scope resolution operator, ...
class A
{
class B
{
};
B m_b;
B* SomeFunc();
};
A::B* A::SomeFunc()
{
return &m_b;
}
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: Missing semi-colons, non-descriptive class names, missing scope resolution operator, ...
I just simplified the class.
Anyway, I found my problem, which does not depend to this demo sample. Thanks.
// "Life is very short and is very fragile also." Yanni while (I'm_alive) { cout<<"I love programming."; }
|
|
|
|
|
Hamed Mosavi wrote: Anyway, I found my problem
Cool
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi all, I've been struggling with the WinAPI CreateProcess for some time now. I've googled/yahoo'ed all over to find a simple explanation on how to use it and i havnt found anything close to how to use it properly. I know it takes 10 parameters in order to use so says MSDN. But im still not finding a way to use it for something simply. Any help and or suggestions on the matter is greatly appreciated. Thanx in advance!
|
|
|
|
|
So the "example" provided in the MSDN online documentation is not "simple" enough? or you can't get it to work? or....???
|
|
|
|
|
You can pass NULL, 0, and/or FALSE for all the parameters except
lpApplicationName, lpStartupInfo, and lpProcessInformation.
That should simplify it
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
|
dellthinker wrote: I've googled/yahoo'ed all over to find a simple explanation on how to use it and i havnt found anything close to how to use it properly.
Beyond words.
Why not show us what you've tried so we can see where you've gone astray?
"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
|
|
|
|
|
Im having trouble with this.
<br />
#include <windows.h><br />
#include <iostream><br />
using namespace std;<br />
<br />
int main(i)<br />
{<br />
CreateProcess(("notpad.exe"),NULL,NULL,NULL,FALSE,0,NULL,NULL,NULL,NULL);<br />
printf("Failed because: %s", GetLastError());<br />
<br />
return 0;<br />
}<br />
|
|
|
|
|
dellthinker wrote: int main(i)
What's this?
dellthinker wrote: printf("Failed because: %s", GetLastError());
Should be:
printf("Failed because: %lu", GetLastError());
"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
|
|
|
|
|
Is "notpad.exe" the app you want to run?
Also you need to pass something to those last two parameters, especially the
last one, since there's some handles returned that need to be freed.
STARTUPINFO StartupInfo;
memset(&StartupInfo, 0, sizeof(STARTUPINFO));
StartupInfo.cb = sizeof(STARTUPINFO);
PROCESS_INFORMATION ProcessInformation;
if (0 == ::CreateProcess(_T("C:\\Windows\\system32\\notepad.exe"),
NULL,
NULL,
NULL,
FALSE,
NORMAL_PRIORITY_CLASS,
NULL,
NULL,
&StartupInfo,
&ProcessInformation
))
{
TRACE1("Failed because: %lu", ::GetLastError());
}
else
{
::CloseHandle(ProcessInformation.hProcess);
::CloseHandle(ProcessInformation.hThread);
}
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
|
Hi for all
I'm developing a single MDI app. I have the following matter:
When I click the close button on the parent window, teorically it will send a WM_CLOSE and process the PostQuitMessage(0). But this is not occuring.
What I really want to know is how can I close and MDI app carrectly.
Look at the code below. This is the code of a class that I've create to create windows:
<br />
<br />
WPARAM TemplateWindow::MessageLoop()<br />
{<br />
while(!m_bQuit)<br />
{<br />
if(PeekMessage(&msg, m_hwnd, NULL, NULL, PM_REMOVE))<br />
{<br />
if(msg.message == WM_QUIT)<br />
{<br />
if(m_uiType == MDI)DestroyWindow(m_hwndFrame);<br />
m_bQuit = true;<br />
break;<br />
}<br />
else<br />
{<br />
if(m_uiType == MDI)<br />
{<br />
if(!TranslateMDISysAccel(m_hwndFrame, &msg))<br />
{<br />
TranslateMessage(&msg);<br />
DispatchMessage(&msg);<br />
}<br />
}<br />
if(m_uiType == SDI)<br />
{<br />
TranslateMessage(&msg);<br />
DispatchMessage(&msg);<br />
}<br />
}<br />
}<br />
else<br />
if(m_uiChildCount > 0)<br />
{<br />
SendMessage(childsInfo[0].hwnd, WM_PAINT, NULL, NULL);<br />
<br />
}<br />
SwapBuffers(m_hdc);<br />
}<br />
return msg.wParam;<br />
}<br />
This is my code in the callback of the main window:
<br />
LRESULT CALLBACK MainWindowCallback(HWND hwnd, UINT uiMessage, WPARAM wParam, LPARAM lParam)<br />
{<br />
HMENU hMainMenu;<br />
hMainMenu = CreateMenu();<br />
static int siRuler = IDM_NEWRULER, siText = IDM_NEWTEXT, siNodule = IDM_NEWNODULE, siPath = IDM_NEWRULERPATH;<br />
switch(uiMessage)<br />
{<br />
case WM_CREATE:<br />
{<br />
...<br />
break;<br />
}<br />
case WM_CLOSE:<br />
{<br />
delete TextMenu;<br />
delete RulerMenu;<br />
delete PathMenu;<br />
delete NoduleMenu;<br />
delete ProceedingMenu;<br />
delete ScreenShotMenu;<br />
PostQuitMessage(0);<br />
break;<br />
}<br />
...<br />
default: return DefFrameProc(hwnd, g_hwndClient, uiMessage, wParam, lParam);<br />
}<br />
}<br />
The WM_CLOSE message is processed, BUT the PostQuitMessage(0) not. It process some part of this function. I'm debugging the app and when it enters in this part:
7E419483 call 7E418860
The app doesn't process, it doesn't freeze, just doesn't continue to process other register.
Anyone can help.
|
|
|
|
|
You post the quit message before you destroy the window
and exit the message loop before the window is destoyed.
From WM_CLOSE, you should call DestroyWindow(). Then when you get
the WM_DESTROY message, call PostQuitMessage.
Also, your message loop is really inefficient. You should use GetMessage(), not PeekMessage().
Also, why are you sending invalid WM_PAINT messages directly to windows? You should never
send a WM_PAINT message.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark, the window is destroyed, but when I look in the task manager the process continues in there. Do I need to close the mdi childs first? One of them is create with the RichEdit style. Is there a relation between the loaded dll("RichEd20.dll") and this fact?
I putting the PeekMessage because in the RenderHwnd(an HWND that modified to receive OpenGL), I have some images that should be show in this window.
I'm sending the WM_PAINT because if I don't do this, the RenderHwnd remains static, the WM_PAINT message is just processed if I move the window. Because this fact occurs, I send the WM_PAINT.
|
|
|
|
|
There's MANY messages that need to be processed before the windows are completely destroyed.
You are exiting your message loop before these are processed.
As far as the process not ending, I have no idea what you do after your message loop terminates.
Again, you should NEVER send a WM_PAINT yourself. There are other ways to properly mark a window
for repainting. See InvalidateRect(), UpdateWindow(), RedrawWindow(), etc.
Your message loop is VERY inefficient (well, it should be efficient at using all your CPU cycles).
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Right, can you say what messages I need to handle to increase the code?
|
|
|
|
|
Except for messages you need to handle, the default window proc is fine.
The point is they'll never get processed if you exit your message loop.
Here's an example of what I'm talking about - problems/changes marked in red.
Note where I put PostQuitMessage() and where DestroyWindow() is called.
WPARAM TemplateWindow::MessageLoop()
{
<font color="Red"> while(GetMessage(&msg, m_hwnd, NULL, NULL))
</font> {
if(m_uiType == MDI)
{
if(!TranslateMDISysAccel(m_hwndFrame, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
if(m_uiType == SDI)
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
<font color="Red">
}</font>
return msg.wParam;
}
LRESULT CALLBACK MainWindowCallback(HWND hwnd, UINT uiMessage, WPARAM wParam, LPARAM lParam)
{
HMENU hMainMenu;
hMainMenu = CreateMenu(); <font color="Red">
static int siRuler = IDM_NEWRULER, siText = IDM_NEWTEXT, siNodule = IDM_NEWNODULE, siPath = IDM_NEWRULERPATH;
switch(uiMessage)
{
case WM_CREATE:
{
...
<font color="Red">
break;
}
case WM_CLOSE:
{
delete TextMenu;
delete RulerMenu;
delete PathMenu;
delete NoduleMenu;
delete ProceedingMenu;
delete ScreenShotMenu;
<font color="Red">
return DefFrameProc(hwnd, g_hwndClient, uiMessage, wParam, lParam);</font>
}
<font color="Red">case WM_NCDESTROY:
PostQuitMessage(0);
break;</font>
...
<font color="Red">default:
break;</font>
}
<font color="Red">return DefFrameProc(hwnd, g_hwndClient, uiMessage, wParam, lParam);
}</font>
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Well Mike, I made the changes that you said to me, nut unhapilly it doesn't work. Any other suggestion?
Thanks for the support man.
|
|
|
|
|
I'm Mark
How far is it getting? If you set a breakpoint in your WM_CLOSE handler, does it get there?
How about WM_NCDESTROY?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|