|
It can be a solution for all platforms, only you have to create a normal window - not message only - a bit more overhead, but should work.
If you want to receive a message, you need a window (WM_ stands for Window Message ) for window you need a message pump...
Or might be there will be a better way how to detect the windows shutdown, but I don't know them from the head now.
|
|
|
|
|
Can I add active GIF onto a dialogue box under Visual C++6.0? Using Window OS from Win98, Win98SE, Win2000 and WinXP.
On Visual C++ 6.0, how to I identify a user who is having what kind of privileges? (i.e admin privilege, etc)
|
|
|
|
|
hello all,
cau any one tell me, in VC++ what messege do i need to send in the button function so that when ever the user clicks the button on the dialog box which is created in an SDI application, the cursor moves up in the client area , where my button is member dialog class and object of button class
void MyDialog::OnButtonup()
{
short caps=GetKeyState(20);
BYTE keyState[256];
GetKeyboardState((LPBYTE)&keyState);
if( (TRUE && !(keyState[38] & 1))||(!FALSE && (keyState[38] & 1)) )
{
// Simulate a key press
keybd_event( 38,0x45,KEYEVENTF_EXTENDEDKEY|0,0);
// Simulate a key release
keybd_event(38,0x45,KEYEVENTF_EXTENDEDKEY|KEYEVENTF_KEYUP,0);
}
}
but this code dos't compelete my requirement
|
|
|
|
|
Hi,
I am working with MDI application. I want to ovverwrite ID_APP_EXIT, File->Exit menu function of Mainframe menu. When I click on this menu option or on the close icon button of Main frame, I should check for a particular condition and then allow to exit the application if condition is true or else I should not allow the user to exit.
I am able to overwrite and check the condition, but unable to close the application if condition is met. If I used PostQuitMessage(0), it's getting closed but I'm getting lot of memory leaks due to this function.
Can anyone please help me to do this?
Thanks
Madhavi
|
|
|
|
|
Try
AfxGetMainWnd()->PostMessage(WM_CLOSE);
Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!
|
|
|
|
|
Everywhere it says: "Create project by going to Other Projects/Extensibility Projects". I don't have that! OTOH I don't have the Pro version of VC++. Is that needed ? I've download the VSIP 2003 SDK, that don't help either
/Rob
|
|
|
|
|
File > New... > 'project'
TOXCCT >>> GEII power [VisualCalc]
|
|
|
|
|
Thanks, but... that was what I said. There are no "Extensibility Projects" and thus no Add-in wizard
|
|
|
|
|
i use VS pro and i never see this either sorry
TOXCCT >>> GEII power [VisualCalc]
|
|
|
|
|
Hi!
I need to draw some information on screen, without having to create a window. Here my code:
<br />
CWnd* pDesktop=GetDesktopWindow();<br />
CDC* pDC=pDesktop->GetDC();<br />
CBrush* pOldBrush=(CBrush*) pDC->SelectStockObject(BLACK_BRUSH);<br />
CPen* pOldPen=(CPen*) pDC->SelectStockObject(NULL_PEN);<br />
pDC->Rectangle(0,0,100,100);<br />
pDC->SelectObject(pOldBrush);<br />
pDC->SelectObject(pOldPen);<br />
pDesktop->ReleaseDC(pDC);<br />
This code is not working, nothing appears on screen!
What's wrong? Do I need to create a transparent window and draw on this window?
Thks in advance!
Appstmd
http://www.atlence.com
|
|
|
|
|
Hi. I’m a VC++ programmer that have plans to use some functionalities from MSN Messenger into my programs.
I need some kind of tutorial on how to start… I’ve earlier coded against MS Outlook and MS PowerPoint so think I could get most things quite fast.
Really need some tips on where to start!
_____________________________
...and justice for all
APe
|
|
|
|
|
How can i copy a system file that is already in use
CopyFile fails with error GetLastError -> 32
i am tring to copy SAM,SOFTWARE...(Registry) files in XP
i have an application that backs up registry and it is copying all files to a folder
do i need some security tokens to copy these files
please help
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
Any good suggestion or links for taking MCSD Exams for VC++ ?
|
|
|
|
|
Hello Friends,
I am having CListView in which I am displaying some image and underneath them I having some text. The Main problem is that whenever the text is not having sufficient space then its displaying ... and when I select the text gets wrapped to the next line.
Please give me a solution for not displaying the three dots(...) and the text should be displayed on the next line.
Thank you in advance.
Neelesh K J Jain.
|
|
|
|
|
Hi,
While I've never done anything with images and text in a ListView I have an idea that might help you. This is the same thing that happens if you look in any folder and the name is too long. The obvious reason you get the "..." is because displaying the full name could overlap with an image below the text. Each row has a certain height to it and if the text goes beyond the height it gets truncated. At least that's how I see it. So my idea is for you to manually override the row height and change it to make the text fit. I don't know if this definitely will work, but its worth a shot.
Edit: After messing around inside a folder, it seems that there usually is enough space to display most names without doing that. Maybe there is a property you can check to allow it to display?
|
|
|
|
|
HI ,
I wanna help on a simple application.
I have 2 applications in c language.
First application 'A' has some data being written in a text file 'T'.
Second Application 'B' simultaneously is reading that data from the same file 'T'(if any) and producing the desired output.
Can it b done n how.
amit mishra
|
|
|
|
|
set a flag in the registry (or in a temporary text file).
this way, by testing the flag before writing or reading, you could know if you are allowed to (or not)...
prog1 :
if (!flag) {
<font color=#0000FF>int</font> fd = fopen(<font color=#808080>"T"</font>);
fprintf(<font color=#808080>"some datas to write"</font>);
fclose(fd);
flag = <font color=#0000FF>true</font>;
}
prog2 :
if (flag) {
<font color=#0000FF>int</font> fd = fopen(<font color=#808080>"T"</font>);
<font color=#0000FF>char</font> strTab[100];
fscanf(<font color=#808080>"%s"</font>, strTab[0]);
fclose(fd);
flag = <font color=#0000FF>false</font>;
}
TOXCCT >>> GEII power [VisualCalc]
|
|
|
|
|
What you should do is lookup "Named Pipes". This is in essence exactly what you want to do. Do a search on SS_Log on Codeproject and you'll find the SS_Log_Server article that does exactly that.
|
|
|
|
|
a language question. i have the following:
-------------------
class BUFFER{
public:
char* string;
int size;
~BUFFER()
{
delete[size] string;
}
};
-------------------
void func1(BUFFER buf)
{
...
// on exit, the original "buf.string" will be deleted, because the
// destructor is called once
}
-------------------
void main()
{
BUFFER mf;
mf.string = new char[20];
lstrcpy(mf.string, "test");
func1(mf); // <-- after this returns, the mf.string
// was deleted once, and will be deleted the second
// time when "main" returns in the second call to the
// destructor, which will lead to an error
}
-------------------
The question is:
how can i override this behavior? i want the buffer in "string" pointer to be a copy of the original too - just like the "size" attribute, so there won't be a second delete called in destructor for the same pointer.
Thanks.
|
|
|
|
|
The easist way to fix this is to pass the BUFFER to func1 by reference.
void func1(BUFFER &buf)
{
...
} What is happening in your code is that when func1() is called, a local copy of BUFFER is made that is destroyed when the function exits. By using a reference, you access the original BUFFER, not a new copy, so it does not go out of scope at the end of the function, and it's destructor is not called.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
i know that by reference does that, but i don't wan't to use this method. i want the original to be completley seperated from the one inside the function.
does overriding the "=" operator affects an object transferred by value?
|
|
|
|
|
What you need then is a copy constructor in your BUFFER class. Have the copy c'tor make a copy of the string. The default copy c'tor just copies the pointer.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
but how would i know if the object was created locally by the function because it was passed as a parameter, or a user created it for his own use?
i want that if a user creates an instance of this class - the string will be set to "NULL" in the constructor, but if it is passed as a parameter - all its content will be replicated and not point to the original information.
|
|
|
|
|
do this in your class definition :
<font color=#0000FF>class</font> CBuffer {
<font color=#0000FF>char</font>* m_pcString;
<font color=#0000FF>int</font> m_iSize;
<font color=#0000FF>public</font>:
CBuffer() {
<font color=#008000>
m_pcString = 0x00000000;
m_iSize = 0;
}
CBuffer(<font color=#0000FF>const</font> CBuffer& refBuf) {
<font color=#008000>
m_pcString = <font color=#0000FF>new</font> <font color=#0000FF>char</font>[refBuf.m_iSize];
<font color=#0000FF>if</font> (m_pcString != NULL) {
<font color=#0000FF>this</font>->m_iSize = refBuf.m_iSize;
}
}
~CBuffer() {
<font color=#008000>
<font color=#0000FF>delete</font>[m_iSize] m_pcString;
m_iSize = 0;
}
}; then, when you call your function with a CBuffer as parameter, this one is copied by the copy constructor in local when the function is called, and destroyed when the function exits. in any case the global object is affected by the construction/destuction of the local object.
TOXCCT >>> GEII power [VisualCalc]
|
|
|
|
|
I know I can use GetDeviceCaps(desktopDC,BITSPIXEL) to get the bit depth, but what if the desktop is 16 bpp. How do I find out if its RGB555 or RGB565?
Thanks in advance.
|
|
|
|