|
I'm assuming that you mean that you don't want the MainFrame window sizable. If that's correct, you can check out this page:
http://support.microsoft.com/support/kb/articles/Q133/2/56.asp
Hope that helps,
Frank
|
|
|
|
|
Hi
I have client-server functionlaity set up
I can send normal text strings properly,
BUT
I CANNOT send a class thgough the socket! it is a pointer to a class, and when i say... sizeof(*myclass) it gives 82 which is smaller than an IP packet (i think).
It comes through as gibberish... How can I fix this?
Why does it work for strings, but not custom classes??
Thanks!
|
|
|
|
|
Noite that when I send it, it is of the form:
mp_sConnectSocket->Send(mp_pdu, sizeof(*mp_pdu))
where
mp_sConnectSocket is the connecting socket
mp_pdu a pointer to the class Im trying to send
sizeof(*mp_pdu) gives the size of the object being pointed to
|
|
|
|
|
I have an app where I have decided to use a wave file. I call the wave with...
sndPlaySound("WaveName.wav", SND_SYNC);
I have included the Windows Multimedia Component in
StaAfx.h...
#include MMSystem.h
#pragma comment(lib, "winmm.lib")
Problem: Release build!
The release Build only finds the wav file if it is in the same folder. What I would like to do is make the wave a part of the app just like any other resource, instead of a separate file. I have experimented with the .rc and .rc2 files to no avail. I know it can be done (for example the SpeakN sample app in VC++6.0). Perhaps I'm going about it the wrong way. Any help or suggestions would be appreciated.
|
|
|
|
|
Thats because you have not given the full path along with the filename.Try giving the full path along with the file name.I think that will work fine to play the wave file from any part of the system.
|
|
|
|
|
Hi,
Is there a way to open a child window/dialog FOR a window
from a DLL that's loaded into the parent? I tried to open
a window which was a child of the Visual C++ window, and it
was very strange. It didn't behave like a regular child window. I should mention that my DLL was loaded into VC
using Customize->Add in & Macros.
Thanks.
|
|
|
|
|
Is this a modeless dialog? Are you using MFC? Is the Dialog using MFC? Modeless (and modal, but that's less of an issue) dialogs must call IsDialogMessage in order to process things like tab keys and arrow keys.
What do you mean by "didn't behave like a regular child window"? That's as good as simply saying "It doesn't work".
|
|
|
|
|
I'm trying to create a modeless dialog. Modal dialogs are not a problem. The only way I was able to create a modeless dialog is by creating another thread from my add-in. Once I tried to create a child window. The window was created, but its caption bar was never painted when it was supposed to receive focus. Still, it could be moved around. When it was maximized you could still see its caption bar VC's client area (unlinke regular child windows). So, apparently I was doing something wrong. Any idea how to do it correctly?
Thanks.
|
|
|
|
|
Yes, I'm using MFC. I'm trying to do all this from an add-in project. I'm trying to create a modeless dialog. Modal dialogs are not a problem. The only way I was able to create a modeless dialog is by creating another thread from my add-in. Once I tried to create a child window. The window was created, but its caption bar was never painted when it was supposed to receive focus. Still, it could be moved around. When it was maximized you could still see its caption bar VC's client area (unlinke regular child windows). So, apparently I was doing something wrong. Any idea how to do it correctly?
Thanks.
|
|
|
|
|
I don't understand why you needed to create another thread to create a modeless dialog. That should not be necessary. In any event, it definately sounds like IsDialogMessage() is not being called for your dialog. I'm not familiar enough with add-ins to know how it's messages get processed.
|
|
|
|
|
For some reason, AfxDaoTerm is not being called when I close my database. The database is created using new equated to a member pointer (of type CDaoDatabase*) of my document. When I destruct the document I close the database and then delete it. I then delete some other objects and, then, the destructor terminates. At that point I get an assertion on line 42 of Daocore.cpp which, according to the comment, indicates that AfxDaoTerm is not being called. If I place an explicit call to AfxDaoTerm after deleting the database pointer, I do not get the assertion and my application exits without apparent problem. Any hints as to what might be going on?
Thanks.
|
|
|
|
|
There are a few articles in the MSDN KB that talk about how MFC calls AfxDaoTerm from the ExitInstance of CWinApp, and how this can create problems with DAO objects declared at global scope or in DLLs etc.
Seaching for afxdaoTerm will bring up about 4 or 5 articles that are almost-but-not-quite your scenario.
Calling AfxDaoTerm directly is indeed one of the solutions mentioned.
HTH
|
|
|
|
|
How do I change the TitleBar color (background and text) ?
|
|
|
|
|
I can not figure out the syntax how to copy my compiled DLL to another directory, or if I should put that code in the commands or outputs section on the Custom Build Tab in the Project Settings. I am looking to put the compiled DLL outside of the target directory. Using MSVC++ 6
Thanks in advance.
|
|
|
|
|
In the Project->Settings->Post Build Step tab, try something like:
Debug: copy Debug\*.dll "D:\SomeOtherFolder\MyFolder"
Release: copy Release\*.dll "D:\SomeOtherFolder\MyFolder"
|
|
|
|
|
How can I make the text on a tab look as if it is grayed out (to make the tab have the effect of not being able to be selected). I have an app with multiple tabs, and several of those need to be disabled at specific times. I realize I can make the tab unable to display the appropriate dialog when being clicked but how do you make the text have the look of being grayed out?
|
|
|
|
|
This might help...
http://support.microsoft.com/support/kb/articles/Q151/6/62.asp
Good luck,
Frank
|
|
|
|
|
Hi!
How would the code for overriding the OnPaint() function look like? I have been trying to set the color of a slider I created with MFC. I managed to color it's background but didn't manage to change the slider "knob" or "path" color, how is this done?
I also have a Combobox wich I would like to change the color of as well, but it didn't work out either.
Then there's the frame of the window, I beieve I should override OnNcPaint() function for this but either I'm wrong or doig it wrong. =)
And changing the color of the entire application menu would be very nice if I could do this too.
Thanks in advance!
/Fredrik
|
|
|
|
|
OnPaint() is the wrong way to do it. You can change the thumb and track colors pretty easily using custom draw.
As for the combobox, look up the docs on CWnd::OnCtlColor().
|
|
|
|
|
Ah, I have tried to do custom draw but I don't get it to work, how do I make menu and the other things(mentioned earlier) with custom draw, I could use some samples of code, since I seem to be doing something wrong when I don't get it to work. =)
Thanks,
/Fredrik
|
|
|
|
|
My application asks user to enter a hex value. First of all, can I read and store it in a variable directly as hex value? If not, I should declare a CString to read and store it, right? Then, how can I covert this CString value into hex value. An example will be most appreciated. Please help. Thank you.
|
|
|
|
|
Hi,
One solution is:
CString sHexNumber = "ABC";
DWORD dwDecNumber = 0;
sscanf( sHexNumber, _T("%16x"), &dwDecNumber );
Best regards
Holger
|
|
|
|
|
Howdy all,
I'm looking for either a library or a snippet as to how to parse tokens embedded in nested parentheses. For instance, I need to convert something like:
(A, B, (C, D))
into a tree like:
A
B
(Parent)->C
(Parent)->D
Of course, other trees would have different formats:
((A, B), C, D)
((A,B), (C,D))
etc..
I think this borders on a grammar topic, but my brain isn't quite what it used to be ;-( Any suggestions would be welcome. Thanks.
|
|
|
|
|
Probably need to use Polish Notation logic. I don't remember just how it goes, but you should be able to
find a compiler design book that covers it.
|
|
|
|
|
I think there is an expression parser in the CodeGuru web site but there might be one in this web site too. They might help but might be too much.
I think you only need a syntactical parser. You probably do not need a symantics parser. Are you familiar with Lexx? It is a compiler that generates a syntactical parser written in C.
Also see: http://www.snippets.org/ and look for "Jari Laaksonen's comment utilities in C++" near the bottom. It might help.
|
|
|
|