|
There are two things you need to do:
First define your functions in the DLL so VB can call them correctly:
// DLL external entry points for VB
long WINAPI MyTestFun1(HWND hwnd, int a, int b)
long WINAPI MyTestFun2(HWND hwnd, int a, int b)
// Then you will need a def file for the DLL so the entries are public and VB can pull them out
LIBRARY MDLL
DESCRIPTION 'Test DLL'
EXETYPE WINDOWS
EXPORTS
MyTestFun1 @1
MyTestFun2 @2
Your VB defines look correct so it should work with these changes.
|
|
|
|
|
Good day,
I want to create a CListBox in which item index 0 & 1 have image(bmp or icon) with text and the next indexes are plain text. How can i achieve it?
I have search examples and found an image listbox but when i insert plain text on the successing index, still the plain text will not be on its normal location that is on the leftmost area because the area now is reserve for image, but i only wanted index 0 and index 1 to have an image, the rest is plain text.
Thanks a lot.
More Power!
|
|
|
|
|
What styles does the listbox have?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
LBS_NOTIFY | WS_VSCROLL | WS_BORDER
Selection:Single,
Owner Draw:Fixed,
Has String enabled,
Thanks...
|
|
|
|
|
By the way im on Embedded Visual C++, in case it matters
|
|
|
|
|
Anonymous wrote:
Owner Draw:Fixed,
Just a guess, but what happens if you use LBS_OWNERDRAWVARIABLE instead of LBS_OWNERDRAWFIXED ?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Ok I'll try.
Thanks David.
|
|
|
|
|
I want the information about
how can we implement the camera capture click event in MFC application in VC++.
|
|
|
|
|
Could you explain that?
Don't try it, just do it!
|
|
|
|
|
Hi, currently, I have an activeX control which will be created by one thread, and control will be used by many other thread. I only wish ONE thread to access the same method at ONE time.
What If
1. My control already have a synchronized mechanism handling, i.e. each method of the control is protected by CRITICAL_SECTION. May I know which thread model i should use?
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED) - single thread
or
CoInitializeEx(NULL, CO_MULTITHREADED) - multi thread
2. My control method is not protected by any CRITICAL_SECTION. again, what thread model i should use?
thanks!
cheok
|
|
|
|
|
If you don't have a sycronization mechanism in your control use COINIT_APARTMENTTHREADED (single threaded apartment) but make sure you call CoInitialize in each thread you want to access the control, and also you have to marshall object's interfaces to all threads from which you want to call the control, otherwise you'll get an exception.
If you have a syncronization mechanism use the other model, multi threaded apartment and in this case you don't have to marshall interfaces.
|
|
|
|
|
Can I please re-phrase your word?
1. For COINIT_APARTMENTTHREADED (single threaded apartment), I created a control in thread A (which had make a call to CoInitializeEx). If there is another thread B wish to use the control, thread B had to make call to CoInitializeEx/ CoUninitialize before/ after using the control.
However, in multi thread apartment, I just need to call CoInitializeEx ONCE in thread A. thread B need NOT to call CoInitializeEx.
2. May I know what is mean by "marshall interfaces" ?
Thanks
|
|
|
|
|
Yes something like that, but in single threaded apartment model other threads have to call CoInitialize before using the control, not after.
In multi threaded apartment although it's not necessary for each thread to call CoInitialize, it's recommended to make that call, to avoid problems, like access violations.
If you access a COM interface from another apartment you'll get an exception, so when you are using single threaded apaprment model you have to marshall interfaces between threads. You do that by calling CoMarshalInterThreadInterfaceInStream() from the thread in which you called first CoInitialize(), and pass the IStream interface you get to the other thread, from which you want to access the object. In that thread call CoGetInterfaceAndReleaseStream() passing the IStream as argument and you'll get the interface.
The easiest way is to marshall the IDispatch interface, because after that you can call directly any methods you want.
|
|
|
|
|
marshall interfaces seems not easy
i think i will go directly for multithread apartment to avoid using marshall interfaces. since providing a synchronized protection on my activex control object much easier.
thanks for help. this solve my doubt.
|
|
|
|
|
How to create a Excel file in Visual C/C++
Pls Help me
thanx in advance
KK
|
|
|
|
|
Hi,
show to http://www.codeproject.com/cpp/miniexcel.asp.
It may help you
Best regards
|
|
|
|
|
Check out MSDN article Q178749.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
How to change font of tooltip of Toolbar in MDI App developped with VC++6 and MFC ?
Any suggestion/solution?
Ana
|
|
|
|
|
I suppose you could subclass the tooltip and change the font or create your own tooltip class window and do whatever you like.
|
|
|
|
|
dear all,
pls mail me with the origin of visual studio, perticularly about VC++.
the help files are some what complex and hard for me to easily understand so pls send me some sites which explains about the general use of visual studio.
what r the vs tools and its use?
thk u for the trouble.
best regards
Ajo T.
|
|
|
|
|
Use MSDN help on Visual C/C++. It was very useful and easy to understand
by
KK
|
|
|
|
|
i understand that MSDN is help full but is there any other sites which give me details
|
|
|
|
|
Hi
Other useful sites are www.programmersheaven.com and www.codeguru.com
you can also download samples from above site
With Regards
KK
|
|
|
|
|
Will this[^] help you......?
|
|
|
|
|
Your question is way too broad to be answered in just a sentence or two (e.g., there are whole books devoted to the subject). What exactly are you wanting to know?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|