|
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.
|
|
|
|
|
GetCurSel uses MCM_GETCURSEL which doesn't fill in the time members in the SYSTEMTIME stucture.
SYSTEMTIME tSysTime;
m_uiCalendar.GetCurSel(&tSysTime);
tSysTime.wHour = 0;
tSysTime.wMinute = 0;
tSysTime.wSecond = 0;
tSysTime.wMilliseconds = 0;
COleDateTime dtDate(tSysTime);
Step through the code or search for _AfxOleDateFromTm in the source to see where the COleDateTime is set to invalid.
|
|
|
|
|
In my COM object with MFC support I want to install a timer:
::SetTimer(NULL, TIMER_ID, 1000, (TIMERPROC)TimerProc);
Then I declare MyTimerProc() in COM class as:
VOID CALLBACK TimerProc(
HWND hwnd, // handle to window for timer messages
UINT message, // WM_TIMER message
UINT idTimer, // timer identifier
DWORD dwTime) ; // current system time
and define as:
VOID CALLBACK TimerProc(
HWND hwnd, // handle to window for timer messages
UINT message, // WM_TIMER message
UINT idTimer, // timer identifier
DWORD dwTime) // current system time
{
// Do something
}
But I've got a compiler error:
error C2440: 'type cast' : cannot convert from '' to 'void (__stdcall *)(struct HWND__ *,unsigned int,unsigned int,unsigned long)'
None of the functions with this name in scope match the target type
What am I doing wrong ?
|
|
|
|
|
typedef VOID (CALLBACK* TIMERPROC)(HWND, UINT, UINT, DWORD); is defined in WINUSER.H.
It looks like it depends on whether STRICT is defined - take a look at the WINUSER.H header. If not, TIMERPROC is defined to nothing, which is what the compiler is complaining about. If defining STRICT causes probs, you might try just using the straight cast.
Of course, its early in the morning, and I might be missing something... timers in COM objects... hmmm...
|
|
|
|
|
I use ICOpen to open a video compress driver, and ICCompressBegin to start to compress data, and ICCompress to encode data; but from ICCompress, I can't get the compressed data length. I think each of
the compressed video frame are different size.
using ICCompressGetSize? I always get the same value.
Some one can help me?
Thanks
|
|
|
|
|
use iccompressgetformatsize()
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|