|
"this" pointer is not null at any place (from constructor to destructor).
ur problem is the (parent) window has not been created in constrctor.
WM_CREATE is right point to create child window - but, some MFC classes filter the message - check if the message is really past to ur code if has trouble.
includeh10
|
|
|
|
|
the wm_create is not passed...
|
|
|
|
|
Ok, here's the situation: I've created a new MDI app (with Appwizard) to which I've added four CFormView's. I've registered to Document Templates ok and can open new views without any problem.
The thing is these views are to operate sequentially (there is only one document) - i.e. the user will complete all the nessecary bits on one form, then click a button whoch will open a different form and close the current one.
The new view opens OK, but i'm having difficulty closing the first one without getting various nasty access violations etc. I gather from MSDN that DestroyWindow is the thing I should be calling, but that I should be calling this for both the view and frame - is this right? If so I cannot get it to work at all (shuts down ok but I then get all sorts of access violations which seem to be caused by some bit or other being left in memory).
Any body know how to do this? It strikes me as something pretty elementary but I just can't get a grip on it. Help!
All I want to do is close the view totally.
Alex.
|
|
|
|
|
I also need help on how to restart a program from within itself...
Basically I have a need to reload my program from scratch if a user changes some options. I'm not sure how to accomplish that, so any suggestions or hints would be really helpful!
Thanks in advance,
Dennis
MCP, MCSD
|
|
|
|
|
Can't you just make it ShellExecute it's own exe (passing down any command line options if appropriate) and then quit the original?
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
Strangely enough, it works!
I just didn't think of that option because I am limiting my application to one instance only in InitInstance and I thought that the thread wouldn't be destroyed as fast as it does and it would block the launch of a new one. But it doesn't. Thanks.
MCP, MCSD
|
|
|
|
|
Hmm, in that case it's worth testing rigourously (especially on slower machines) as it may end up failing some of the time.
Another solution would just to be to run a secondary application (or batch file) that's job is to just pause until the main app is quit, and then relaunch it
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
Hello,
Please help to understand the ways of the Rich Edit OLE...
I'm able to insert and item into my Rich Edit Control (I'm using a dialog-based app) by creatig IRichEditOle and the rest and then using ->InsertItem()... (its from MSDN)
Now, it does seem to insert it (by looking at the rtf string before saving), but after I actually save, the file size gets bigger and bigger, but I don't see anything I've inserted (instead there's just a single space for each item I've inserted).
My guess is that objects do get saved, but I just don't know how to read them back and the Rich Edit Control (v2) doesn't do that automatically. I've tried using GetObjectCount() and then GetObject(), but the first function returns a 0.
Can anyone direct me to any samples or articles please?
Thank you in advance,
Dennis
MCP, MCSD
|
|
|
|
|
Hi
I have to get know whether some process is running. I want to identify the process by the name which is shown in Task Manager. The problem is I don't know how to find out whether the process is running using the name from Task Manager. Thanks for any hints.
Mariusz Popiolek
|
|
|
|
|
Search MSDN for Q175030. You'll find code there for this.
lazy isn't my middle name.. its my first.. people just keep calling me Mel cause that's what they put on my drivers license. - Mel Feik
|
|
|
|
|
A bit complicated but should work, thanks!
Mariusz Popiolek
|
|
|
|
|
I read a CP post a long time ago about a neat little trick in VS.NET. You could make it autogenerate GUIDs everytime you started to type "uuid(" and the like.
Please help me remember!
--
standing so tall, the ground behind
no trespassers, on every floor
a garden swing, and another door
she makes it clear, that everything is hers
A place of abode, not far from here, Ms. Van de Veer
|
|
|
|
|
It must be inside an attribute declaration, like this: [uuid(" and VS.NET will fill it for you
lazy isn't my middle name.. its my first.. people just keep calling me Mel cause that's what they put on my drivers license. - Mel Feik
|
|
|
|
|
Argh. Why did they not put this feature in IDL-files?
I think I'll do some VB.NET-scripting within the near future!
--
standing so tall, the ground behind
no trespassers, on every floor
a garden swing, and another door
she makes it clear, that everything is hers
A place of abode, not far from here, Ms. Van de Veer
|
|
|
|
|
How can I make that the user can not change the width of a column of a list view control (CListCtrl )?
I have a list view control with a non sortable header (with the LVS_NOSORTHEADER flag) and want to make that the user can not change the width of the only column I have.
How?
Daniel
---------------------------
Never change a running system!
|
|
|
|
|
Create another listCtrl that handles that message and that's all.
1. Create new class.
2. Select MFC class.
3. choose the CListCtrl as the base class.
4. implement the pretranslatemessage function in that new class in order to filter/handle the allowed messages. (use the spy++ in order to get the messages you want to eliminate.)
5. include your header file in the dialog/view you want to use it.
6. (if you are using a dialog), insert a normal listctrl in the dialog editor.
7. assign a variable to that listctrl and in the type of the variable choose your new class.
that's all.
(I suppose you'd know al those steps, and probably they are not the best ones to reach your purpose, but doing this you'll have all the data needed in order to be able to do it...)
Hope this helps.
|
|
|
|
|
Thanks! I will try it!
Daniel
---------------------------
Never change a running system!
|
|
|
|
|
Hi Thomas,
I guess the easiest way for you to access dBASE is to use MFC database classes (CDatabase, CRecordset etc.) together with dBASE ODBC driver.
I suggest you search for "links, examples and more" yourself using Google or any other Web-based search tool. Just specify "dbase", "ODBC", "MFC", "example" as keywords, and I'm pretty sure you'll get hundreds. Doing it yourself will help you develop skills that are important for every programmer.
Best regards
Vagif Abilov
MCP (Visual C++)
Oslo, Norway
Hex is for sissies. Real men use binary. And the most hardcore types use only zeros - uppercase zeros and lowercase zeros.
Tomasz Sowinski
|
|
|
|
|
How can one use *.fon font in VC++ application?
How to load fon font?
Thanks
|
|
|
|
|
I have this below CString data
<br />
CString m_str; <br />
m_str += "CAST";<br />
I need to change m_str to hex CString data. So I use this below function
<br />
CString m_hexstr<br />
m_hexstr.Format("%02X", m_str); <br />
So I get m_hexstr = {"BC3E5C"}
But I want to ask about how to change back from hex CString data {"BC3E5C"} to CSting data {"CAST"}.
Thank you for your reply.
|
|
|
|
|
I think I get the wrong answer.
Because "CAST" should result in 8 letters. (2 per ASCII character).
I think Format does not work ok this way.
So I want to ask. Is there a way to convert m_str = {"CAST"} to hex character and how to change back?
Thank you for your reply.
|
|
|
|
|
You want to save your strings characters as their ASCII-representation to a hexadecimal base?
Converting into hex is easy: Make a std::map<char, string> and look up the translation.
For the opposite direction, use another std::map<string char> and look up the chars for every hex-digit.
|
|
|
|
|
loop on the chars, read each char, cast it into an int, format that int into a string using %2X and concatenate all the resulting chars
Same idea to bo back but reversed
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Does WinCE support ownerdraw list view controls (CListCtrl)?
Daniel
---------------------------
Never change a running system!
|
|
|
|
|
Hello Friends,
I have a very intresting question .
The problem is that i have written an application(.exe) it uses a .dll file i.e few functionality are provided in the dll file . as the file is used it is loaded dynamically now the problem is that i want to change this dll without unloading the application is this possible??? i have done some changes in the dll so without unloading the application can i unload the dll and again reload it. but as the dll is loaded it is not replaced by the new dll in that folder .
can any one suggest me a option for it????
i have to change the dll and not swap.see i have a folder called ABC in this abc folder i am having my application app.exe and all called xyz.dll.
now my applixcation app.exe is running and it is using the xyz.dll.so the xyz.dll is loaded .Now i want to replace this xyz.dll in the folder and that loaded in the application i.e is app.exe. is it possible???
Tryout are also welcome.Please suggest some technique to do this
|
|
|
|