|
Just change "strText" by "(char*)((LPCSTR)lpDrawItemStruct->itemData)" when drawing the text.
My test is working. Good luck !
|
|
|
|
|
does anyone know how to determine whether windows requires a login or not.
i.e. need to know if a system is multi-user or not.
cheers
Neil
|
|
|
|
|
Using VC++ 6.0
I'm writing a DLL and it works fine from a C++ program. However, a friend of mine wants to use the DLL from a VB app.
My exported prototypes look like this:
extern "C" void FAR PASCAL EXPORT SR_GetString(char* sRunning);
typedef void (FAR PASCAL* LPFNsr_GetString)(char* sRunning);
I also have a .DEF file with this export line:
GetString @1
In my C++ program (that uses this DLL), I do this:
HMODULE hMyDLL = ::LoadLibrary("MyDLL.DLL");
LPFNsr_GetString m_fnSRGetString = GetProcAddress(hMyDLL, "SR_GetString");
char cText[255;
(m_fnSRGetString*)(cText);
I get the expected results (cText contains the expected string).
My Objective:
I want to make this DLL VB-friendly (*NOT* VB-specific) while having minimum impact on the code I've already written in both my C++ app and the DLL in question. I plan on requiring 32-bit VB in order to use the DLL, so the 16/32-bit concerns should be NULL.
If anyone can steer me, give me hints, tell me outright how to do it, etc, I'd be most appreciative.
Last thing, besides the DLL, what file(s) do I have to give the VB programmer who wants to use it?
|
|
|
|
|
i posted an answer to your jsimmons3@satr...... account
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
damn - i'm at work...
Could I convince you to post it here too?
|
|
|
|
|
i dont think i can upload an attachment here and theres a lot of code to rifle thru if i'm to sort out the bits you need only
is there an email at work i can send it to?
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
the VB person only needs the DLL and perhaps your .h file so he (i'll assume "he") can see the function declarations. then he'll need to write some VB function import/declarations for your DLL. if you're kind, you'll write these function declarations for him
as far as compatibility - VB can deal with C interfaced DLL's (not C++) pretty well. i tend to stick with 32-bit parameters, and if i have to pass a structure, i make sure the elements of that structure are all 32 bits. this way VB can use "Long" for all of your parameters (except strings).
the only thing you really need to be careful of is getting the VB function declarations right - match parameter sizes and get the correct ByRef/ByVal flags on those parameters.
-c
------------------------------
Smaller Animals Software, Inc.
http://www.smalleranimals.com
|
|
|
|
|
Hello. I´m trying to run a new program from a mfc application. I have probed with
'system', but a new DOS windows appears. Does anyone how to manage it?
|
|
|
|
|
|
Do you know any way to inicializate a CMapStringToString like a static array? In a static array I do it:
CString array_of_string[]={"dog","cat","horse"}
but in CMapStringToString, is it possible? Thanks
|
|
|
|
|
G'day Jane,
I don't think you can do this as the CMapStringToString class doesn't
have an '=' operator.
If you derived you own class and added an '=' operator, you'd need to
pass it two values (a key and string) which I don't think would work.
(BTW: I'd be perfectly happy to be proved wrong here. )
Do you only need to do this for a single CMapStringToString object?
Maybe you could derive a class from CMapStringToString which initializes
itself in the constructor from a couple of static text arrays.
Something like this...
static char* lpszKeys[] = {_T("Key1"), _T("Key2"), NULL};
static char* lpszText[] = {_T("Text1"), _T("Text2"), NULL};
CMyMapStringToString::CMyMapStringToString()
{
int nPos = 0;
while(lpszKeys[nPos] != NULL){
SetAt(lpszKeys[nPos], lpszText[nPos]);
nPos++;
}
}
This might get a bit tedious if you have several different
CMapStringToString objects to self-initialize though.
Just a thought.
Steve
--------------------------------------
Steve Driessens
www.resortsoftware.com
|
|
|
|
|
I need a process to be started right when all dialog init is done and the window has been displayed, what is the easiest way to do this??? I'm sure this is very simple
|
|
|
|
|
put a call to CreatProcess() [or CreateProcessEx()] at the end of your InitDialog() function or trap the WM_SHOWWINDOW message and put it there after calling the base class handler
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
i have a thread prgm which will be running for 24 hrs... and i am getting an error after 10 hrs.. the error is "Abnormal program termination".. what will be the cause??
REPLy me immediately
Regards
Rose
|
|
|
|
|
errrrr
thats a bit vague rose
a little more info might help get an answer
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
"I have a car which is supposed to be running for an hour, but after 15 minutes, something happens. What's the cause?"
|
|
|
|
|
The reason your program only runs for 10 hours is because you are using a signed value as a message id for message passing between threads, and 10 hours is roughly how long it takes you to exceed the maximum positive value and wrap negative. Your receiving thread expects unsigned values. In essence, your problem has nothing to do with threads.
|
|
|
|
|
am i missing the original thread here?
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
OK. Good luck with it then.
|
|
|
|
|
|
Why would you DO such a thing ????
|
|
|
|
|
Hi there,
I'm trying to work with a CTreeCtrl and what i'm trying is to close all the expanded nodes when
another node is opened.
How can i do that ???
Thanks alot,
Ariel.
|
|
|
|
|
catch the TVN_ITEMEXPANDED message and close the others you want to there
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
Try the TVS_SINGLEEXPAND style
Considderd to be the worlds fastest knoppenbonker.
10 Months of working experience with the worlds fastest copie paster(about 2000 lines a minute). And Experience with the man wich made the longest phonecall of the world
And experience with the one and only NewEra Guru.
|
|
|
|
|
Hi there All,
I'm trying to Retrive the Date in form of COleDateTime from a CMonthCalCtrl
and CDateTimeCtrl but not very succesfull at this.
I'm trying to Use the BOOL GetCurSel( COleDateTime& refDateTime ) const; function
but then i get an invalid Date - i tried to catch different Messages of the Above
Controls and none of them do the Job.
Can somone please Help me, Just a short Code example to see
how its done will be more than enough.
Thanks in advance,
Ariel.
|
|
|
|