|
I'm trying to calculate and return the value needed to display proportional thumbs inside scrollbars...
The function takes as arguments
1) The virtual size of the window or DC
2) The visible size of the client area
I think these are the only parameters needed to calculate the thumb size...???
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Just a few things i want to say about your posted code:
1) The first line inside the function reads:
if(nVirtualWidth <= nVisibleWidth) return -1;
But the declaration of the function is UINT, so it will return 0xFFFFFFFF. I assume you know this.
2) Second line inside the function:
float temp = ((float)nVisibleWidth / (float)nVirtualWidth) * (float)nVirtualWidth;
This long line does nothing other than:
float temp = (float)nVisibleWidth;
You first divide and then multiply the result with the same value you divided with?
3) Third and last line:
return nVirtualWidth - (nVirtualWidth - percentVisible);
For this you can simply write:
return percentVisible);<br />
<br />
This code seems to be improvable ;)<br />
<br />
:-D<br />
-Dominik
|
|
|
|
|
Dominik Reichl wrote:
) The first line inside the function reads:
if(nVirtualWidth <= nVisibleWidth) return -1;
Thank you...I was wondering the scroll bars were hiding themselves automatically...I totally missed that one.
What can I say I hate math so very much...
What steps are required then in calculating the proportional thumbsize of a scrollbar...
I supply the function
1) The virtual width
2) The visible width of client
these two variables should be more than enough to calculate the thumb size no...?
Thanx
cheers
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Hi,
I wrote a WinAPI (no MFC) app that implements IDropSource and all neccessary interfaces. I needed my app to support drag & drop. But I stuck with the WM_DROPFILES for the target, because it's way easier. But now, I'd need to accept both MOVE and COPY drops. As it seems WM_DROPFILES can't handle this (if it can, tell me!!), I'll need to do the IDropTarget interface implementation. Anybody could post some sourced to guide me? I know that I'd never write the IDropSource without the MSDN source, but I cannot find any on IDropTarget. Thanks
|
|
|
|
|
I'm trying to have several instances of the same activeX embedded in a container application. This activeX is quiet complex, using message queues and graphic displays. If there's no problem on Win2000, NT or XP, the container application crashes on Win95/98/ME when it instantiates the second instance of the integrated ActiveX.
Does anybody have a clue what's happening ? (TIA)
We do not inherit the Earth from our ancestors. We borrow it from our children.
Antoine de Saint Exupéry (1900-1944)
|
|
|
|
|
I am executing my own vc++ exe in VB program using CreateProcessFunction.That vc++exe has one window.When iam working on my vc++ window, I should not allow the person to interact with VB form window.He has to start interact only when i close the vc++ exe.How to do this.
|
|
|
|
|
Can you disable windows in VB? Something like DisableMyFormRightNowPlz function?
Tomasz Sowinski -- http://www.shooltz.com
"Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.
|
|
|
|
|
Try calling WaitForSingleObject with the VC's process handle
Concussus surgo.
When struck I rise.
|
|
|
|
|
It must use hook?who can introduce the easy way?
Hi
|
|
|
|
|
I'm thinking you could:
Use FindWindow() to find the parent window in which you listview/ctrl resides. Iterate the the child windows using GetWindow() and stop when you find the window whose class is "SysListView32" or "msctrls32" or whatever...actually use SPY++ first to determine the class name, cuz i'm unsure...
Once you have the handle to that listview window attach it to an CListCtrl object and goe nutts...extracting items just like you normally would...
cheers
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
I have tried it.But it don't work.I think it maybe use pointers and other application can't access your pointer.
Hi
|
|
|
|
|
|
Thanks!It works.
Can't I ask you another question?
I also want to get the item RECT.I use ListView_GetItemRect() in the
same way,but when run it report memory violation.I think it maybe
use other parameter.How can I do it?
Thanks again!
Hi
|
|
|
|
|
Is it possible to send WM_KEYDOWN message to a window that is currently minimized, and the window reacts just as if the user presses the key on it?
|
|
|
|
|
I don't know if windows filter out messages when minimized, but I think what you are trying to accomplish is possible...of course if you tried it you'd know for sure...
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
hi, i tries to load a .x file but keep failing... i got this code fragment from a text...
code as follows:
HRESULT result = m_pD3D->CreateMeshBuilder(&m_pMeshBuilder);
if(result != D3DDRM_OK)
return FALSE;
result = m_pMeshBuilder->Load("model.x", NULL, D3DRMLOAD_FROMFILE, NULL, NULL);
if( result != D3DRM_OK)
{
MessageBox("Load error");
}
QUESTION 1: I realise HRESULT is a COM structure. How can i get more specific hint from result?
QUESTION 2: is there any specification to how 3ds files are converted into .x files using conv3ds.exe? the original model.x that comes with the book works just fine. But when i use other .x files i got from other sources, result != D3DRM_OK... and i cant figure out why?
QUESTION 3: I cant find documentation for ???::Load method
QUESTION 4: LPDIRECT3DRMMESHBUILDER structure documentation?
Thanx
|
|
|
|
|
if the conv3ds.exe you're using does not come with the SDK version you're using I don't recommend you use as it might be an older format. IIRC the DirectX SDK comes with a MAX plugin. Look for it. It should be under the tools folder.
Do you have the Debug version installed and selected?
If you do, what does the debug spew say?
Always, always use the Debug version and look at what it says. It catches alot of useful stuff (redundant state changes for example). Also, if you have any rendering probs use REFRAST as it will allow you to separate bugs in your code from bugs in the drivers. If the problem persists when using REFRAST then the problem is in your code.
HTH
Brian Azzopardi
bibamus, edamus, cras moriemur [eat, drink, for tomorrow we die]
|
|
|
|
|
norm wrote:
QUESTION 1: I realise HRESULT is a COM structure. How can i get more specific hint from result?
Add a watch with "result,hr" to see the message. (without quotes)
Concussus surgo.
When struck I rise.
|
|
|
|
|
Hi!
I'm building an MFC application and I'm trying
to link a home made .lib to it. The library
uses the STL. When I try to compile the MFC
app, I get messages like these:
error LNK2005: "public: __thiscall std::basic_string<*snip*> already defined in MainFrm.obj
and
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _memmove already defined in libcmt.lib(memmove.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _vsprintf already defined in libcmt.lib(vsprintf.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _fclose already defined in libcmt.lib(fclose.obj)
I can work around it, but I don't know what the
root problem is. I think it's releated to which
run time library the app uses. Any ideas?
Shawn
|
|
|
|
|
Try changing the C Runtime libs of your application to match your lib. This way, CRT symbols won't get duplicated.
Concussus surgo.
When struck I rise.
|
|
|
|
|
Most of this has nothing to do with the STL, but rather the C runtime library.
Christian
We're just observing the seasonal migration from VB to VC. Most of these birds will be killed by predators or will die of hunger. Only the best will survive - Tomasz Sowinski 29-07-2002 ( on the number of newbie posters in the VC forum )
Cats, and most other animals apart from mad cows can write fully functional vb code. - Simon Walton - 6-Aug-2002
|
|
|
|
|
Looks like that works. Thanks
Shawn
|
|
|
|
|
I have a list view and i want it so that when the user clicks on an item in the list, the box that surounds the selected item and greys it out a little does not appear. How can I accomplish this?
There's always one more bug.
|
|
|
|
|
Two ways AFAICS:
1) Override OnLButtonDown() in a derived class and have it save the current selection index (incase you need that item later) then SetCurSel(-1) to prevent any further selection.
2) Ownerdrawn or custom drawn your choice
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Hi Everyone,
I have been stuck with this questions for two days, could anybody help me
out?
I want to add customized counters to Performance Monitor(PerfMon.exe) in
Win2000, so that in Performance Monitor I can monitor some data defined by
myself in my application. I have referenced two articles "Instrumenting
Windows NT Applications with Performance Monitor"
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnperfmo/h
tml/msdn_ntperf.asp) and "Enable your VB components to talk with the Windows
Performance Monitor"
(http://www.devx.com/premier/mgznarch/vbpj/1999/05may99/kk0599.pdf)
But these two samples all don't work correctly on my Windows2000, that is in
Performance Monitor I still can't see the performance object I want to add.
I have checked the Registry, everything seems fine.
Since these two articles all talk about WindowNT, I am wondering if this is
the problem because I am working on Win2000. What should I do in Win2000?
Has anyone ever written this kind of application, can you give me a hint on
how to make your application expose counters that can be analyzed in
Performance Monitor?
Thanks!
Sherry He
|
|
|
|