|
like this:
::ShowWindow(::CreateWindow("Button","Button1",WS_CHILD|WS_VISIBLE,10,10,100,50,m_hWnd,NULL,AfxGetApp()->m_hInstance,NULL),SW_NORMAL);
|
|
|
|
|
I'm writing a (COM-based) toolbar for IE. At some point I found "new" returned NULL whenever the data size became larger than 300K.
Then I tried ::HeapCreate to create a heap of initial size 1M, but when I used ::HeapAlloc to allocate a chunk of 500K, it said "not enough quota". (It works when the size is 300K, though)
Then I used IMalloc::Alloc to allocate memory, and allocating 1M memory succeeded.
I'm totally puzzled why new and HeapCreate failed and IMalloc would succeeded. Is there some kind of limit on the memory size of a DLL(as my toolbar is compiled into a DLL which is loaded by IE)?
Anybody has any idea?
Thanks a lot.
|
|
|
|
|
I am trying to design an mp3 player similar to winamp but I want some ideas on how should I save the location of every name of mp3 or audio file in the list.
I mean how do you think winamp stores it's list with music. Is it making a temporary file with all the files exactly e=when they are added and then if you double click a certain item in the list it serches for the text in the file and then the next line is the path . . . Can you please give me some ideas on how can i save the paths for the mp3-s of the list after it is loaded because I don't want the mp3-s to be stred in the list full path becasue they look horible.
Thank you.
gabby
|
|
|
|
|
WinAmp saves its playlist like an XML file. Just open the winamp's playlist in Visual Studio and you will exactly see the format.
Hope this helps.
Still Alone in this beautiful world
My Articles
|
|
|
|
|
|
In 2003 last time i checked its called "use managed extensions" property.
As far as using MC++ I'm not sure what to say. MC++ is going to be outdated very soon because Microsoft is working on enhanced support for .net with C++/CLI. The syntax is very different. There are going to be a few tools to help migrate but you still need to do a code review to make sure everything is right. But of course if you really need .net support then go for MC++
|
|
|
|
|
thank you for you advises and I'll update my codes.
|
|
|
|
|
Howdy all-
I want to write a DLLHOST replacement -- an EXE that can be called by IIS to generate output...
I already have an ISAPI DLL that does this stuff, but I want to get out of that, and into a model I have more control of.
Do any of you out there know how to do this?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.santacruznetworks.com">Santa Cruz Networks</A>
|
|
|
|
|
I want to change mdi child frame window size, instead of default size. I know I could change it at PreCreateWindow(). but at that time it's not known what size it should be. the size depends on view. so I change the size at view::InitialUpdate(), but it won't work.
void CMdiView::OnInitialUpdate()
{
// TODO: Add your specialized code here and/or call the base class
CChildFrame* p = (CChildFrame*)GetParent();
p->OnSize( SIZE_RESTORED, 800, 800 );
CView::OnInitialUpdate();
}
Can anybody tell me why?
|
|
|
|
|
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
|
|
|
|