|
But one thing, while pasting the recangle block you have to give necessary blank lines, else will be appended to the exiting lines....
|
|
|
|
|
actually, in some cases that is desirable too!
|
|
|
|
|
True..
|
|
|
|
|
I have a project that I need to communicate with another host PC using MODBUS/ TCP. I have no idea in doing this MODBUS TCP program. Can give some source code in doing this MODBUS TCP. I really need help.
THANKS for help.
|
|
|
|
|
|
i created a DLL with some functions that i'd use in a VB or someother application,
but the problem is for every exported function , i need to do like
[code]
Private Declare Function MyTestFun1 Lib "MDLL.dll" (ByVal hWnd As Long, ByVal a As Integer, b As Integer) As Integer
Private Declare Function MyTestFun2 Lib "MDLL.dll" (ByVal hWnd As Long, ByVal a As Integer, b As Integer) As Integer
[/code]
what i need is like, when u create an object using Microsoft scripting runtime, you'll get access to FileSystemObject. (fso)
so in VB, you do like
[code]
Dim fso as new fileSystemObject
later on you'd use all functions by fso.(dot)..
[/code]
how'd i do my own dll like MSScripting runtime..?
regards,
Rookie
-- modified at 4:37 Thursday 22nd September, 2005
|
|
|
|
|
Try creating DLL through ATL COM and make each function as interface.
<bold>- Nilesh
<italics>"Reading made Don Quixote a gentleman. Believing what he read made him mad" -George Bernard Shaw
|
|
|
|
|
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
|
|
|
|