|
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++
|
|
|
|
|
here the service creates the event and wait for the event to occur.
using WaitForSingleObject ,i am checking in the service as shown bellow
service
DWORD
WINAPI IpcThread(LPVOID lpParam)
{
HANDLE ghRequestEvent = NULL ;
ghRequestEvent = CreateEvent(NULL, FALSE,
FALSE, "Global\\Role_Set") ; //creating the event
if(NULL == ghRequestEvent)
{
//error
}
while(1)
{
WaitForSingleObject(ghRequestEvent, INFINITE) //waiting for the event
//here some action related to event
}
}
Application
Here in application ,opening the event and seting the event
unsigned int
event_notification()
{
HANDLE ghRequestEvent = NULL ;
ghRequestEvent = OpenEvent(SYNCHRONIZE|EVENT_MODIFY_STATE, FALSE, "Global\\Role_Set") ;
if(NULL == ghRequestEvent)
{
//error
}
SetEvent(ghRequestEvent) ;
}
this is the code i wrote.waiting for your responce
Thanks & Regards
Navaneeth
modified on Wednesday, September 24, 2008 2:47 AM
|
|
|
|
|
navaneethm wrote: ghRequestEvent = OpenEvent(EVENT_ALL_ACCESS, FALSE, "Role_Set") ;
Does it work if you use
ghRequestEvent = OpenEvent(EVENT_ALL_ACCESS, FALSE, "Global\\ Role_Set") ;
instead?
If not, is OpenEvent() succeeding?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks Mr.Mark Salsbery for showing the intrest and helping me.
Yes i changed accordingly (i used "Global" in both application.please see the updated code).
The error i am getting in console application (where i am opening the event) is error no 5(Access is denied. ) .
i am running both application(serivce and console application) with administrative privilege (i logged in as Administraor and running the console application by right clicking and using the option "run as administrator") .
i am looking forward for your reply
Thanks & Regards
Navaneeth
|
|
|
|
|
You may want to look carefully at the event access rights.
You don't need EVENT_ALL_ACCESS.
EVENT_MODIFY_STATE is the only access your app needs.
You certainly shouldn't have to run with elevated privileges just
to get a handle to a global event object
Synchronization Object Security and Access Rights[^]
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|