|
You need to take into consideration using TCHAR instead of char cause all the charaters in your program are in two bytes.
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
Hello,
(VC++ 6 SP5)
I have a simple MFC dialog-based app with ActiveX control in it.
This is a control written by friend of mine.
VC created a nice wrapper class for me.
Control displays just fine during execution.
THE PROBLEM:
When I try to access a method from the wrapper class, the program compiles
BUT during execution MFC throws exception : Wrong number of parameters.
BUT THE NUMBER OF PARAMETERS IS GOOD!!
Wrapper for the method has a good prototype etc.
This method can be invoked in ActiveX Control Test Container and in some other 3rd party tool.
So... what's going on??
The message pops out during Debug. In Release, no message, no action.
Thanks in advance for any input
Przem
BTW.
Original method prototype:
BOOL CPrismEdCtrl::LinkReport(long report_handle)
Wrapper class method prototype:
BOOL CPrismEd::LinkReport(long REPORT_HANDLE)
----------------------------
"Fate it'seems is not without a sense of irony"
|
|
|
|
|
hi, i am hoping someone can give me some hints as to how to debug a layered service provider.
I have got microsoft's latest sample code from the SDK and it's up and running. i really just want to play around with it to see how it works. The problem comes because after i have compiled and loaded in the LSP dll using the install exe, all the network services are using it even after i uninstall it. this means i can't recompile and overwrite the old dll with a new one because my computer is still using the old one. i can reboot my machine to free it up and then install the new dll but i don't really want to reboot everytime i want to test alterations to my code.
Can anyone help me come up with a way of developing my LSP which avoids this problem?
many thanks
andy
|
|
|
|
|
Hi, I'm a little confused...
Under MBCS the following code works...
---------------------------------------------------------------------
main_doc->SelectByID(au2B(CEditUPara::UComp),au2B("COMPONENT"), 0, 0, 0, &retval);
main_doc->ShowComponent2 ( );
=====================================================================
But under Unicode, i needed to do this for a particular part of the code...
---------------------------------------------------------------------
CString type = "COMPONENT";
BSTR ucomp = CEditUPara::UComp.AllocSysString();
BSTR Type = type.AllocSysString();
main_doc->SelectByID(ucomp,Type, 0, 0, 0, &retval);
main_doc->ShowComponent2 ( );
=====================================================================
The weird thing is that,
---------------------------------------------------------------------
main_doc->IParameter(au2B(Diameter), &dim );
=====================================================================
still works in some other parts of the code...I can compile and run it successfully...Why is this so??
Thanks!
|
|
|
|
|
In MBCS, a 'character' as the user thinks of it may be one or two bytes and in Unicode, it is two bytes.
More info regarding conversion from Unicode to mbcs refer MSDN with key as "MBCS/Unicode conversion"
The chosen One
|
|
|
|
|
In UNICODE, all the characters are in two bytes. (english characters, chinese characters, kanji characters, vietnamese character, etc )
In MBCS, english characters A-Z , a-z are in single bytes, but some characters like numeric 1- 10, chinese characters, kanji characters, vietnamese character, etc should be treated as two bytes or else you will not be able to read it properly.
You need a in depth study to understand it.
For your case as I assume you do not know about the languages like Chinese, Kanji, and etc. I suggest you to stick to UNICODE.
Just my suggestion.
Hope this helps.
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
|
I see, au2B is defined like this,
#define au2B( STUFF ) auT(STUFF)
#define au2B( STUFF ) (LPTSTR)((LPCTSTR)STUFF)
but i'm still not sure what that means...and why there are 2 definitions...
Thanks for ur help guys...
|
|
|
|
|
I am uploading mltiple files at a time using FTP protocol. For this i am using multithreading. Each file is transferred through a different thread. But when i start more than one thread my CPU usage shoots up to 100 % and then everything becomes very slow. and sometimes the application hangs. What might be the reason for this???
|
|
|
|
|
are u looping somewhere?
hint
Sleep
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
hi,
What kind of syncronization objects u r using? Whats the priority of threads u have set?
I think u have posted this question few days back. Did u check with Trace() function as per suggested by somebody.
The chosen One
|
|
|
|
|
Synchronization object used is Critical section and priority of all the threads is Normal.
There is no looping. I have removed all the infinite loops.
Well to communicate with the main thread i am using SendMessage and not PostMessage. Is this the culprit???
As it is recommended to use PostMessage. I have to pass some structure and if i use PostMessage then that sturcture passed to the PostMessage function goes out of scope. So i have to use SendMessage for that. If there is any other alternative to achieve this.
|
|
|
|
|
samhita wrote:
SendMessage and not PostMessage. Is this the culprit???
Sure it is - You can't SendMessage from a thread (as you have seen demonstrated )
samhita wrote:
[...]that sturcture passed to the PostMessage function goes out of scope.
Construct that structure on the heap (new ...). (Your whole process with all threads shares one memory space)
Then send the address of that struct with PostMessage and do not delete it in your calling function. With the call to PostMessage , you transfer the ownership to your message handler.
After use (in your message-handler), you call delete on the struct, so as not to leak memory.
Hope this helps
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
|
Michael Dunn wrote:
[Sendmessage from a thread]
But then you have to do a lot of synchronisation yourself.
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
after execute an app by CreateProcess() function, we can establish communication pipe between the app and its owner (another app).
the owner, in some way, is a "command window".
now i want to use shared memory between the 2 apps.
the Q comes from java jdb.exe (an app).
when i use dos command window to execute jdb.exe, they communicate properly.
but when i use my app to execute jdb.exe, they can't communicate each other.
the reason is that the commanication must be on shared memory, not pipe (ip is possible OK but not in our case).
do you have any idea that how dos command window use sheared memory or how an user app use shared memory whth other apps?
thanks in advance.
includeh10
|
|
|
|
|
|
Hi, can u please tell me how to remove icon from header in CListCtrl ?
Thanks.
|
|
|
|
|
hi,
IN LVCOLUMN structure, give blank image id.
This should work.
Chill
Anand
The chosen One
|
|
|
|
|
Thx but text is not formated right , there is a space between text and border
|
|
|
|
|
What space u c is not space it is blank image.
Live with it if possible
The chosen One
|
|
|
|
|
hi,
for my application backend is mysql. for crystal report i need to create ODBC dsn on run time. any one help to me.
thanks in advance.
|
|
|
|
|
How do i get the mapped drive information?
Suppose I map a folder Shared of machine A to drive h then how to get the mapped drive information like which folder is mapped to this drive.
Suvarna
|
|
|
|
|
Check out WNetGetConnection() .
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
I am setting font to menu items. For this i have set the onwerdraw property to true and implemented DrawItem.
In WndProc Procedure the lparam parameter is type cast to Drawitemstruct. This has one field as itemId which specifies the menu item id.
In windos 2000 i am not able to get this item id correctly, if the menu item has a submenu. for example if my menu is like
File Edit Search
|-------Open |-----Find
|-------New |-----Find Next
|------Close
Then it does not give itemid of file properly, some big value is assigned to itemid which is not correct. Similarly i am not getting itemid of search as well. For rest of the items Open, New, Close,Edit, Find and Find Next i am getting the correct item id and i am able to change its font and font size.
This concludes that if any menuitem has a submenu then its item id is not assigned properly. Also this happens in Winows 2000 only and in Windows 98 it shows properly. Can anybody please tell me why it is not assigning correct itemid?
Suvarna Joshi
|
|
|
|