|
Hello,
I'm trying to get my app to start up at location (10,10) of the Windows Desktop every time. In my current implementation, the app starts up at the Windows default location and then jumps to (10, 10)---kinda kludgy and it doesn't look good.
Is there a way to start my app in the right location without having to move it after it starts?
thanks,
JennyP
|
|
|
|
|
Position the app window in CmyApp::InitInstance() after the CMainFrame has been created and before ShowWindow() is called.
Neville Franks, Author of ED for Windows www.getsoft.com and Surfulater www.surfulater.com "Save what you Surf"
|
|
|
|
|
Thanks for the reply.
Here's the relevant code in InitInstance()...
........<br />
AddDocTemplate(pDocTemplate);<br />
CCommandLineInfo cmdInfo;<br />
ParseCommandLine(cmdInfo);<br />
if (!ProcessShellCommand(cmdInfo))<br />
return FALSE;<br />
<br />
m_pMainWnd->SetWindowPos(0,50,50,840,860,SWP_NOZORDER);<br />
<br />
m_pMainWnd->ShowWindow(SW_SHOW);<br />
m_pMainWnd->UpdateWindow();
Using the debugger, I see that the window actually paints (in the wrong place) upon the execution of ProcessShellCommand(). Hmmm.... I cannot put SetWindowPos() above this because the window (as evidenced by the errors) hasn't been created yet. Should I be intercepting another message from a process that executes inside ProcessShellCommand()?
thanks,
JennyP
|
|
|
|
|
CCommandLineInfo::CCommandLineInfo() inits: m_nShellCommand =FileNew
This means ProcessShellCommand() will create an emtpy new document. This maybe causing the app window to display ealier than you want. Step through ProcessShellCommand() and see what it is doing. You may wnt to overide it and do your own thing or if you don't want an new document created add:
if ( cmdInfo.m_nShellCommand == CCommandLineInfo::FileNew )
cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing;
before calling: ProcessShellCommand().
Looking at the MFC source code in your editor is worthwhile.
Neville Franks, Author of ED for Windows www.getsoft.com and Surfulater www.surfulater.com "Save what you Surf"
|
|
|
|
|
WM_INITDIALOG
SetWindowPos()
break;
gabby
|
|
|
|
|
Hello,
I need to implement a multi-line CListView report-style view and think that I'll need to override the CustomDraw message and do a bunch of item reformatting and custom drawing, but maybe there's an easier way?
Any ideas?
thanks,
JennyP
|
|
|
|
|
Few weeks ago, I' ve found a very interesting fractal program ( trial version can be downloaded from http://www.ultrafractal.com/uf305.exe ). And I was wondering if somebody could tell me, how to insert a similar Dialog bar ??
|
|
|
|
|
I've been reading docs for months now, and I still don't have a clue how to do it or where to get indeep information.
I'm looking for a guide howto output messages/text to screen at XP boottime for a win32 console application I wrote. The goal is to tell the user about the progress/status of the tool. I'm talking about the console-like blueisch screen that checkdisk and some 3th party defraggers use when doing stuff at boottime.
Furthermore - since I'm guessing it'll have to be a service application - where do I start it? (from the registry, as a regular autostarting service or what?)
Anyone who can help me on this quest of knowledge could have a good chance of becomming a godlike person in my eyes ... in other words: I would be more than thankfull for any info I get here!
|
|
|
|
|
|
Thank's, but I allready tried that... it didn't do a thing, as if the app was just skipped or ignored. Guess the real question is: how do I "talk" (get a screen handle) to that blue screen?
|
|
|
|
|
This[^] page should be a big help for you...
Wout Louwers
|
|
|
|
|
Thank's guys...
modified 18-Aug-14 7:26am.
|
|
|
|
|
I'm trying to track down a memory leak. It was suggested that fxA() leaks. So I set a breakpoint before execution enters that function and after. When execution stops at the 1st breakpoint, I check memory for the process in Task Manager. F10, and when execution stops at the 2nd breakpoint, I again check memory. Memory is the same! This tells me that fxA() is NOT leaking.
Per Microsoft suppport, fxA() is the 4th biggest leak in the application. Are they wrong, or is this method of checking if a function leaks flawed?
<signature>
It's good to live,
Josef Wainz
Software Developer
|
|
|
|
|
This method of checking leaks is flawed. Memory is allocated in blocks of 4 or 8K. You may have allocated memory that is small enough that an entire new block was not required so you would see no apparent difference in the process' memory usage.
|
|
|
|
|
This makes sense, a CStringArray and CArray are passed in by reference and filled in fxA(). This means fxA() uses memory and doesn't release it upon exit.
That doesn't make this function leak memory though, because it's the calling function's responsibility to release the memory of the CStringArray and CArray when those objects are out of scope.
<signature>
It's good to live,
Josef Wainz
Software Developer
|
|
|
|
|
how was fxA() suggested that it leaked ?
does fxA() allocate memory ( with new or malloc ) ?
is it the task of fxA() to also free that allocated memory ? or is it passed on to the caller or somebody else ?
if you use things like _malloc_dbg or DEBUG_NEW in visual studio, you will be able to really see where the leaked memory is really allocated.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Hi, sorry if this is a really dump question...
How do i check what version the compiler is?
I want to destinguish between Visual Studio .net 2002 and Visual Studio .net 2003 at compile time...
e.g.
<br />
#ifdef VS_NET_2002<br />
do this<br />
#elif VS_NET_2003<br />
do something slightly different<br />
#else<br />
#error compiler not supported<br />
#endif <br />
Thanks for any help!
Andy
|
|
|
|
|
|
fantastic! thanks very much... do you know where there is a list of the different values for vc?
thanks again & merry xmas
Andy
|
|
|
|
|
|
I have just interfaced with my first Corba Server, but the only way I can run my client application is via a batch file as lots of Environment variables need to be set up and they are setup via a batch file whitch then run my program.
So for debugging you lose the Visual Studio IDE.
Are they any way that my program can call this batch file or implement what the batch file does (adds a path to the path variable path and defines these environment variables)
I know I could define all these variable into the system (via My Computer, but they are about 50)
ANy comments please,
Merry Christas,
|
|
|
|
|
Can you not "attach to the process" and debug that way?
In .net 2003 -- go to the debug menu, select "Processes..." and hit the "Attach..." button.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.santacruznetworks.com">Santa Cruz Networks</A>
|
|
|
|
|
Hi Gurus,
My CListView-based control doesn't display items more than 200. Why? I've got no error while calling CListCtrl::InsertItem().
Moreover, CListCtrl-based control in the same application but on different dialog box works without above problem.
I can't realize why. Please, help.
Sincerely Yours,
RadioShark
|
|
|
|
|
What does InsertItem() return when inserting the 201st item?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hi All,
I am using .Net 2002 environment in windows 2000 OS. I am try to convert unicode(Japanese) string to CString. I can convert the unicode string to ansi string(CString) when i set the locale(japanese) in regional options. That was showed like come ascii chars(,"êÜ). If i set the locale to english, then the ascii chars showed as ??? marks. But the need is the unicode convert into some ascii chars like from japanse locale. I tried to set the locale using setlocale() method. But there is no effect. I wrote the code is
setlocale(0,"Japanese");
The default locale is not set. I want to set the default locale dynamically. If anyone have the solution about this problem, please let me know.
Maharaj.M
|
|
|
|