|
I am trying to use the tab control in VS2003, I have added the tab to a dialog template in the dialog editor and used the TCM_INSERTIEM message to add my tabs to the tab control. My question is how do I add a child window to a specified tab? (not using MFC BTW).
|
|
|
|
|
There's lots of info and some sample code here:
Tab Controls[^]
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi.
We are doing TCPIP communications between an old system (DOS) and a WinXP system. We put all the message contents into a struture. Because the DOS side we can not change, we encountered a few problems that seems to be related to byte alignment.
I think on the windows side, it needs to be 4 byte aligned. But on the DOS side it seems to be 2 byte aligned. As a result, it seems when you access a specific variable using pointers or use "sizeof" it gives the wrong result.
Is there anyway to force the alignment correctly so that nothing will be "padded"?
Thanks in adavnce.
Stan the man
|
|
|
|
|
Use pragma pack around your structure definition:
#pragma pack(2)
struct MyStruct
{
..
..
};
#pragma pack()
|
|
|
|
|
HI.
Thanks for the reply. IT only needs to be around the definition call. I do not have to do anything else when I call it or use it then, right? Just want to be sure...
Thanks.
|
|
|
|
|
Stan the man wrote: IT only needs to be around the definition call
What do you mean by "definition call" ? Anyway, it only needs to be around the structure definition. When you use the structure afterwards, the byte alignment will be on two bytes (in this case).
|
|
|
|
|
|
In addition to what Cedric wrote, note that packing alignment may only be part of the problem. Type sizes may be different in old DOS-based software, so an struct member of type int may only be 2-bytes wide in DOS as opposed to 4-bytes wide in Win32.
Peace!
-=- James Please rate this message - let me know if I helped or not!<hr></hr> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
I am using MFC.
In my application i am using two label one for e-mail id and other for certain URL.
Initially I have set its property of Visible to be false.
Now when these two labels have certain values during runtime i want to make them visible.
Please tell me how to make the static labels visible during run time.
Thanks In Advance.
Dhiraj Kumar Saini
|
|
|
|
|
ShowWindow function can be used to make the static control visible during runtime
GetDlgItem(IDC_STATIC)->ShowWindow(TRUE)
u can try using this.
|
|
|
|
|
GetDlgItem(ID_MYCONTROL)->ShowWindow(SW_VISIBLE);
|
|
|
|
|
if(label_has_certain_values_during_runtime)
{
GetDlgItem(IDC_STATIC_EMAIL)->ShowWindow(TRUE);
}
|
|
|
|
|
one thing more to remember they shouldn't have ID liek ID_STATIC! ok
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/xml>
|
|
|
|
|
I have already download the sourcecode of Transparent Flash Control
http://www.codeproject.com/KB/COM/flashcontrol.aspx
now I want to draw something on the flash control, I do it like this
OLECONTAINER(void)::Draw(HDC hdcDraw, const RECT *rcDraw, BOOL bErase)
{
HWND hwnd = GetHWND();
HRESULT hr;
RECT r;
IOleObject *lpO = m_lpO;
IViewObject *lpV = m_lpViewObjectEx ? (IViewObject
*)m_lpViewObjectEx : m_lpViewObject;
// if (!m_bTransparent)
{
RECT rTotal;
::GetClientRect(hwnd, &rTotal);
if (lpV)
{
if (!hdcDraw)
{
hdcDraw = ::GetDC(hwnd);
hr = OleDraw(lpV, DVASPECT_CONTENT, hdcDraw, &rTotal);
::ReleaseDC(hwnd, hdcDraw);
}
else
{
hr = OleDraw(lpV, DVASPECT_CONTENT, hdcDraw, &rTotal);
}
}
TextOut(hdcDraw, 0, 0, "test", 4); // <======= do it like this
return;
}
but nothing happen......how can I do it ?
|
|
|
|
|
Hello evrybody,
I am looking for a Chart control in order to easily draw line graphs. My application is developed in MFC using unmanaged C++. Is there any project available ? Thank you in advance.
Our Philosophy, Mohammed Baqir Al Sadr
|
|
|
|
|
Check my signature
EDIT: by the way, CP has a very nice search for articles features, why not using it ?
|
|
|
|
|
Thank you !
Our Philosophy, Mohammed Baqir Al Sadr
|
|
|
|
|
|
OK.
Our Philosophy, Mohammed Baqir Al Sadr
|
|
|
|
|
Due to poor network connection, sometimes the page does not fully load when I call Navigate. My code performs certain task after the entire page has done loading. Does anyone know if there is a default timeout for Navigate? If not, is there an elegant way to wait for a while before I call Navigate again? I could create a thread to monitor if my OnDocumentComplete function has been called but I am hoping for another way.
|
|
|
|
|
I am answering my own post but I don't think starting a thread and checking to see whether the page has done loading periodically will work because the Navigate call is single-threaded.
|
|
|
|
|
Try this
BOOL m_bReady = 0;
BSTR bsStatus;
CString str;
m_pBrowser->Navigate2(vaURL,null,null,null,null) ;
while(!m_bReady)
{
m_pBrowser->get_StatusText(&bsStatus);
mStr = bsStatus;
if(mStr == "Done") m_bReady=1;
}
|
|
|
|
|
Thanks for the reply. But as I was trying to say with my second post, the browser functions are single-threaded so the while-loop will go into an infinite loop since Navigate2 won't get a chance to run. As far as I know, the only way to check if the page has finished loading or not is to write a call-back function.
|
|
|
|
|
I am creating an appcation on Vista,which include a service and an application .
(i am a new comer)
In my service i am creating an event and waits for that event.In application i am opening the same event and calling setevent function(problem starts here). In service ,its not getting the setevent notification.i searched in the net and saw something about integrity level.its telling that service and applicaation got differnt integrity level.
So it will be very helpfull if you tell how to do the IPC between a service and an application in Vista
Thanks in advance
Navaneeth
|
|
|
|
|
Can you show the code you use to create the event (both sides)?
Also how are you checking if the event is signaled in the service?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|