|
You will need to set a boolean variable at class level:
BOOL m_bInitialized;
And initialize it to FALSE in the constructor.
m_bInitialized = FALSE;
And set it to TRUE in the OnInitDialog() function.
m_bInitialized = TRUE;
Also send a resize message explicitly after setting it TRUE :
SendMessage(WM_SIZE,0,0);
Now modify OnSize() like this:
OnSize()<br />
{<br />
CDialog::OnSize().....
<br />
if (m_bInitialized == TRUE)<br />
{<br />
Resize the client control here.<br />
}<br />
<br />
}
To set an offset you could:
CRect rect;<br />
...<br />
rect.DeflateRect(10,10,10,10);
this is this.
|
|
|
|
|
For some strange reasons all icons in my CListCtrl decided to loose some colors and turn into dull 256 ones. If I display them using CStatic one by one they still have their 16\32 bits but if I'll attach the same image list to list control they turn into 256 ones on display. I have not owner drawn functions or something like that so it can't be the problem.
--------------------------------
Human stupidity is infinite.
|
|
|
|
|
Am I always asking something hard nobody knows about or something dumb nobody things worth of attention ?
--------------------------------
Human stupidity is infinite.
|
|
|
|
|
Hello,
I have a strange problem: I have an Edit Box which is set to Multiline and WantReturn. But if I want to set the text to the edit box with SetWindowText() it seems the \n in the text is completly ignored.
Does anyone have a clue why ?
With best regards,
Benedikt
|
|
|
|
|
|
What do you mean by 'completely ignored' ? You mean that the text following it is not on a new line ?
I think you have to specify \n\r (or \r\n, don't remember exactly) in order to have a new line.
|
|
|
|
|
|
Yeah thank you.
That was the problem. I was too long working with consoles
|
|
|
|
|
Hi guys,
Can somebody help me in opening and closing the cd-rom drive programatically.
<marquee direction="up" height="30" scrolldelay="1" step="1" scrollamount="1" hspace="0" vspace="0">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
|
I tried this before, it did not work out. May be I will try it again.
Thanks khan.
<marquee direction="up" height="30" scrolldelay="1" step="1" scrollamount="1" hspace="0" vspace="0">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
Hi
How to know the serial number of the processor, motherboard, Hd,.... of the PC where is running my application?
I found that I can obtain the HD serial number with GetVolumeInformation(),
but I have problems with the other devices.
Can you help me?
Have a nice code day
|
|
|
|
|
|
Thanks,
but I have some problems to use the functions Win32_DiskDrive.
I have to define these symbols using 'Cimwin32.mof'.
But, How can I use this strange (for me ) files 'mof'?
And also it needed namespace '\root\cimv2', but the compiler give some errors!
If it is a problem, I'm writing a simple MFC doc\view application.
Thank you
Have a nice code day
|
|
|
|
|
_Russell_ wrote: If it is a problem, I'm writing a simple MFC doc\view application.
this article will help
http://www.codeproject.com/system/UsingWMI.asp[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
For cpu-id look for the assembly function cpuid.
|
|
|
|
|
Thank you very much.
It works!
Do you know others assembly functions to know the other devices id (ram, motherboard)?
Have a nice code day
|
|
|
|
|
how to change the readonly option of a record set to upateonly or appendonly..
i am getting an error "recordset readonly"when i go for adding a record thru ODBC api in vc++
if(m_pSet->CanAppend())
{
m_pSet->AddNew();
m_pSet->m_programname="parser";
m_pSet->m_paraname= "main";
if(m_pSet->Update())
TRACE("Row Added OK\n");
else
TRACE("Row Not Added\n");
} // end if CanAppend()
else
MessageBox("Cannot Append");
thanks in advance
Get
|
|
|
|
|
Check out the third parameter of CRecordset::Open() .
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
wrote an application that uses twain for scanning an images using
a scanner.
when the scanner is not connected I get the return value and want to
display my own popup but there is another popup from the scanner.
I tried to call :
ShowOwnedPopups(DefWnd(NULL)->m_hWnd,false);
("DefWnd(NULL)->m_hWnd" has my main window handle).
Still the popup is shown. I think that probobly the popup is generated by
the operating system (Windows).
Is anyone can help me on this?
Thanks,
Lior.
|
|
|
|
|
1)Actually, what i am doing is to integrate two separate Excel & access automation applications into one.
2)First, i finish Excel automation(used excel9.olb(library) & included excel9.h as header file).Upto now it works fine.
3)Now The problem begins. For access automation functionality i use msacc9.olb & include access9.h as header file.As soon as i compile, even before adding any functionality, it shows class redefinition errors for _Application etc.
Apparently, these are due to the object models of Excel & Access which have some same class names like _Application etc. which cause the clash.
There seems nothing wrong with the code but with the libraries of access & excel which have some same class names.
How should i resolve the clash?Please, Please, Please Help!!
Ankush Mehta
|
|
|
|
|
in your headers, did you thought to well add such code :
<font color=blue>#if</font> !<font color=blue>defined</font> (__MY_HEADER_H_INCLUDED__)
<font color=blue>#define</font> __MY_HEADER_H_INCLUDED__
<font color=green>
<font color=blue>#endif</font> <font color=green>//__MY_HEADER_H_INCLUDED__</font>
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VisualCalc 3.0]
|
|
|
|
|
No, i didn't add any such code.where should i add it.please tell in detail.
Ankush Mehta
|
|
|
|
|
i thought it was clear enough... it must round all your definitions in the header it is on...
so, the #if and #define must be before what you declare in the header (others #include can be before that, as they may have their own exclusive statements already) ans the #endif put at the end of the file...
if you have several headers in that case, choose different #define macros for each header, to avoid any problems...
you could look into any compiler header to see how to do...
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VisualCalc 3.0]
-- modified at 5:39 Wednesday 14th December, 2005
|
|
|
|
|
well, please forgive me for asking rather stupid questions. i am a newbie.Let me restate what i have done.
the libraries msacc9.olb,excel9.olb provided by ms-office for automation are added to the project.These libraries contain header files msacc9.h & excel9.h. i include these header files at the top of the .cpp file of my application like this.
#include"msacc9.h"
#include"excel9.h"
Now, please give me directions to resolve the clash(classes like _Application are in both libraries)
Ankush Mehta
-- modified at 6:13 Wednesday 14th December, 2005
|
|
|
|