|
Try this:- Add a hidden button to your dialog, with id
ID_RUN_LOOP .
- Write a handler for the
ID_RUN_LOOP command. The handler should execute the for loop.
- In your dialog's
OnInitDialog() handler, do this: PostMessage (WM_COMMAND, ID_RUN_LOOP); This should cause the loop to be executed after your dialog has been initialized and shown on the screen.
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Another way is to use Timers.
1. Create a timer in OnInitDialog()
2. In the timer function do the for loop and then destroy the timer.
|
|
|
|
|
I have a DLL I wish to use in my app, but I have no associated header, def, lib, etc fils... just the DLL itself.
How exactly do I work with this?
I've tried creating a definition file for it but only 4 functions are generated (DllCanUnloadNow, DllGetClassObject, DllRegisterServer & DllUnregisterServer).
I'm know the DLL provides other functions but how to get to them???
I can load the library but where to go from there? I've tried using GetProcAddress() to retrieve the address of what I think the function I want is called but without success.
Cheers all
--
The Obliterator
|
|
|
|
|
You can see the exact names of the exported functions through Dependency Walker (a tool in vc++). However, u won't be able to see the no. of function parameters, their data types etc.
|
|
|
|
|
Thanks, but that lists just the same 4.
I must be missing something really obvious!
--
The Obliterator
|
|
|
|
|
Those particular functions should be a warning sign: the DLL implements some COM objects.
You could use the OLE/COM Object Viewer (supplied with VC6) to see if it's got a type library (use File > View TypeLib). From here, you can save an IDL file.
|
|
|
|
|
Perfect! Thats what I needed...
I'm not used to these new fangled ways!
Figured out I have to #import the dll into my project and used the idl file to get to various interfaces... cheers.
Seems a very complicated way to me!
--
The Obliterator
|
|
|
|
|
Obliterator wrote:
I've tried creating a definition file for it but only 4 functions are generated
How did you do this?
|
|
|
|
|
|
Hello,
Kindly help me as soon as possible.
Problem:
When i run the "Dialog Based" Application in VC++, then the focus is set currently to the BUtton or any other control.
I want, that the focus should always be set on the "Dialog" even if we press "Button" .
e.g. 1) Run the Application.
2) When i click the button, and after clicking it, the focus should be return to the Dialog.
Hoping for a positive response
EsHbAn BaHaDuR
|
|
|
|
|
I've read a few articles about creating in VC++ 6 programmes with windows that minimize in the system tray. Is it possible to accomplish the same thing with C++ Builder?
|
|
|
|
|
Yes, you can make the same function calls to achieve the effect
|
|
|
|
|
http://www.bcbdev.com/faqs/faq73.htm
|
|
|
|
|
Hi:
I want to change the combobox's style in programme(want it could be edited or not),Can I set the "CBS_DROPDOWN " or "CBS_DROPDOWNLIST " style to the combobox in my programme?I use "modifystyleex",but nothing happen. How to do?
Thanks
Benben
|
|
|
|
|
When I was reading the CListCtrl::SortItems method, I noticed at MSDN there's a sample on how to sort items of a CListCtrl , the sample says:
Example
static int CALLBACK MyCompareProc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
{
CListCtrl* pListCtrl = (CListCtrl*) lParamSort;
CString strItem1 = pListCtrl->GetItemText(lParam1, 0);
CString strItem2 = pListCtrl->GetItemText(lParam2, 0);
return strcmp(strItem2, strItem1);
}
void snip_CListCtrl_SortItems()
{
extern CListCtrl* pmyListCtrl;
pmyListCtrl->SortItems(MyCompareProc, (LPARAM) pmyListCtrl);
}
While it says "The lParam of an item is just its index", I however found its actually the item's 32-bit data, usually 0. Why does MSDN say its an index? Is there some "hidden" way we can get the lParam's as indices? Thanks
|
|
|
|
|
|
Not a mistake in the context of this sample.
The lParam is a piece of data (pointer-sized, i.e. 32 bits on 32-bit Windows, 64 bits on 64-bit Windows) that can be associated with each item. You specify it in the lParam member of the LVITEM structure when calling InsertItem , or you can set it using SetItemData . The lParam values of the two items are passed to the compare procedure.
In this case, the sample code has simply assigned the item number to the lParam of the item. However, you could do something different, perhaps storing the record number of the source record, or a pointer to the object that the list item represents.
If you don't specify a value for lParam , it will be left uninitialised.
|
|
|
|
|
I think the design of this function was simply wrong in the first place. Why did they decide to pass item-data, not indices, to the comparing callback function? Item-data are easily obtainable through "GetItemData" function, whereas indices are difficult to obtain through item-data(no, FindItem won't work if two items have same item-data), even an idiot would see that is a one-way-linkage, yet the designer went ahead and picked the wrong route. Heehe, shame on whoever wrote that function.
|
|
|
|
|
There is system setting:
Big/small/custom size of system font in display properties.
How to get It programmatically ?
thanks
|
|
|
|
|
This is untested code, but should hopefully come up with the right answer
HFONT hGuiFont = ::GetStockObject(DEFAULT_GUI_FONT);
CFont font;
font.Attach(hGuiFont);
LOGFONT lf;
font.GetLogFont(&lf);
int size = -lf.lfHeight;
font.Detach(); // dont delete global resources
Roger Allen - Sonork 100.10016
If your dead and reading this, then you have no life!
|
|
|
|
|
This may seem a little round-about:
GetDeviceCaps(NULL, LOGPIXELSX);
GetDeviceCaps(NULL, LOGPIXELSY); which gives you the number of pixels per inch in each direction.
Setting Small Fonts sets both to 96, Large Fonts sets both to 120, and Custom is something else.
|
|
|
|
|
Hi,
I want to produce a Font, of say size 10 points & with Character ratio 2. In the MFC,I have seen the "CreateFont" method which takes the width as
the 2nd parameter.But How will I get the width of a particular font with size
10 pts.
Could anyone help me regarding this.
Thanks in advance...
|
|
|
|
|
Not sure I understand what you mean. But if you want to know how much space (Wdith) a font takes, select your font in a device context and then use GetTextExtent.
Good luck!
|
|
|
|
|
Thanks for ur reply...........
But I want to know the width of the font,Before I Create the font. My aim is to provide a character ratio for the font.
Iam creating the font using the "CreateFont" method.In this Function,the 2nd parameter is width.So to Create a Font with a particular character ratio,I need to give in this 2nd parameter a value which is equal to (widthoffont * characterratio).
sO THATS why I want to know the width of the font before creating a font before.Is it possible?.
|
|
|
|
|
You will probably have to create this font in 3 stages.
1. Create it using normal parameters to allow windows to choose the correct width for the font height
2. Get the LOGFONT of this font
3. double the width value and CreateFontIndirect() using the LOGFONT
Roger Allen - Sonork 100.10016
If your dead and reading this, then you have no life!
|
|
|
|