|
When handling SB_THUMBTRACK , you need to look at the nTrackPos member of the SCROLLINFO structure, not nPos .
Software Zen: delete this;
|
|
|
|
|
Thank you very much. It works.
MSDN is such a great thing, but it happens the you do not to see the wood for the trees.
|
|
|
|
|
I need a refresher...
Are there any circumstances where using a pointer to an unsigned __int64 value could cause problems for an API expecting a PULARGE_INTEGER? For example, GetDiskFreeSpaceEx()...
If it matters...I'm using VC6 to compile an x86 EXE.
|
|
|
|
|
I had the same problem recently using GetFileSizeEx. Turns out LARGE_INTEGER is a struct.
MSDN says...
The ULARGE_INTEGER structure is actually a union. If your compiler has built-in support for 64-bit integers, use the QuadPart member to store the 64-bit integer. Otherwise, use the LowPart and HighPart members to store the 64-bit integer.
<br />
LARGE_INTEGER nTemp;<br />
::GetFileSizeEx(hFile, &nTemp);<br />
<br />
unsigned __int64 nFileSize = nTemp.QuadPart;<br />
"My dog worries about the economy. Alpo is up to 99 cents a can. That's almost seven dollars in dog money" - Wacky humour found in a business magazine
|
|
|
|
|
Yes, it's OK.
As it turns out, the LARGE_INTEGER struct is identical to unsigned __in64 as far as memory layout goes. The struct was added back in the days when 64 bit integer arithmetic wasn't readily available in the processors, and they provided the arithmetic via library functions.
Software Zen: delete this;
|
|
|
|
|
Thanks Gary.
I should've dug one extra level deeper in the definitions--the struct's QuadPart member is a ULONGLONG, which in turn is an unsigned __int64.
And since the LARGE_INTEGER is a union, then you're right, the memory layout is identical...
|
|
|
|
|
hi every1
im writing a code that needs to compare two poitner of type (void *)
i dont know how to do that; i tries to use the memcmp function but it requires a length parameter !
thanks already
|
|
|
|
|
same question[^], same answers... templates are what you need.
you cannot know what kind of object is pointed to by a void* address...
|
|
|
|
|
If you need to compare the pointer values, just compare them using normal operators. If you need to compare the things that the pointers point to you need more information about them:
int iValueA = 1;
int iValueB = 1;
void *vp1 = &iValueA;
void *vp2 = &iValueB;
void *vp3 = &iValueA;
if( vp1 == vp3 )
{
OutputDebugString( _T( "vp1 == vp3\n" ) );
}
if( vp1 == vp2 )
{
OutputDebugString( _T( "vp1 == vp2\n" ) );
}
if( *(int*)vp1 == *(int*)vp2 )
{
OutputDebugString( _T( "*vp1 == *vp2\n" ) );
} Peace!
[edit] Alright - who is the buttmonkey that voted this a 2 with no reason given? [/edit]
-=- James 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! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
Hello folks,
I trying to instatiate a activex control, print template from Internet Explorer. The argv[1] parameter it's a path string to a HTML file(like these: c:\MyTemplate.htm). But it seems the type of vTemplatePath don't match and an exception is launched:
Error on line 474 atlbase.h
Expression: p!=0
I'm sorry to post this question here, but I'm a noob in C++. I'm a web programer(PHP, javascript, action script II), and I need very much of this.
Someone can help me to solve this?
Thanks a lot!
//Microsoft reference
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnie55/html/beyondprintpreview.asp
//code
int main(int argc, char * argv[])
{
int i;
IOleCommandTarget* pCmdTarg;
CComPtr<iwebbrowser2> pWB;
pWB->QueryInterface(IID_IOleCommandTarget, (void**)&pCmdTarg);
VARIANT vTemplatePath;
V_VT(&vTemplatePath) = VT_BSTR;
CComVariant vPTPath = argv[1];
pCmdTarg->Exec(&CGID_MSHTML, IDM_PRINTPREVIEW, NULL, &vPTPath, NULL);
return 0;
}
|
|
|
|
|
pWB is NULL.
No Webbrowser conrol bas been created.
COM hasn't been initialized (by calling CoInitialize or friends).
Steve
|
|
|
|
|
Use:
CoCreateInstance(CLSID_WebBrowser, NULL, CLSCTX_INPROC, IID_IWebBrowser2, (void**)&pWB);
received same error.
|
|
|
|
|
Call CoInitialize - It should be the first (or close to) thing your program does. The WebBrowser in an ActiveX control - Do you plan in implementing ActiveX control containment youself? I suggest looking up ActiveX controls and how to host them.
Steve
|
|
|
|
|
|
hi all
i had used the code from msdn for making menu with icons/bitmap. which is listed below.
ASSERT(m_CheckBitmap.LoadBitmap(IDB_CHECKBITMAP));
ASSERT(m_UnCheckBitmap.LoadBitmap(IDB_UNCHECKBITMAP));
// Associate bitmaps with the "Test" menu item.
CMenu* mmenu = GetMenu();
CMenu* submenu = mmenu->GetSubMenu(3);
ASSERT(submenu->SetMenuItemBitmaps(ID_HELP_TEST, MF_BYCOMMAND,
&m_CheckBitmap, &m_UnCheckBitmap));
it works fine. but when i click/select the menu item then the color of the bitmaps changes to somewhat like blue. tell me what to do with this.
ddd
|
|
|
|
|
I think that is normal behavior because the system is trying to combine the icon/bitmap with the selection color.
I think you have to do your own owner-drawn menus to get around that. There are articles here on CP (I think) that can demonstrate how.
Peace!
-=- James 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! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
thanks for reply
when i use the menu that r by default means geberated by wizard first time then it works fine no color changes but when i write new menu(own) then this problem occur.
ddd
|
|
|
|
|
I created a dialog based application. My monitor was set to 1024x768. Now when i change it to 800x600 all the buttons are misaligned. How can i write an application that works in all the screen resolution
|
|
|
|
|
size and location?
if yes I suggestion use movewindow in the wm_size
|
|
|
|
|
Did you create the buttons at runtime?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
i also have the simillar problem
but its quite different
Button displayed without misalignment 1024*768 in windows xp of my computer
But it misaligns in windows xp of other computer.
I used skin
can any one help me
JAYARAJ
|
|
|
|
|
J5121982 wrote: i also have the simillar problem
but its quite different
If you have a similar problem, how can it also be quite different?
J5121982 wrote: But it misaligns in windows xp of other computer.
What is the resolution of this computer?
Are you creating the buttons/controls at runtime?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
I think the buttons are created without movewindow(no runtime)
so if resol from 800 to 1024 then location buttons isnt good
|
|
|
|
|
DavidCrow wrote: If you have a similar problem, how can it also be quite different?
Regards,
Nish
|
|
|
|
|
I created the buttons using the resource editor ie dropping the button on the dialog..
|
|
|
|