|
But you can call C library functions from C++ programs. So in this case, would you prefix C library function calls with :: ?
|
|
|
|
|
Defenestration wrote: So in this case, would you prefix C library function calls with :: ?
My point is you can't!
Try prefixing a call to e.g. strlen() with the scope resolution operator. You'll get a compiler error.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Roger Stoltz wrote: My point is you can't!
Try prefixing a call to e.g. strlen() with the scope resolution operator. You'll get a compiler error.
Not if the source filename extension is .cpp
modified on Tuesday, December 9, 2008 5:18 AM
|
|
|
|
|
|
Hi all,
i want to know the difference between DLLImport attribute and creating a COMpointer and creating the instance then acessing the function of a dll...
Thanks in advance.
vikas da
|
|
|
|
|
DLL call in Compile Time
#pragmma comment(lib,"dll name")
Call at run time use
LoadLibrary()
function
|
|
|
|
|
i want to know whats the difference between the two
1.DllImport attribute
2.Coreate instance..with com pointer
to acess a exposed fuinction of a dll
vikas da
|
|
|
|
|
tasumisra wrote: i want to know the difference between DLLImport attribute and creating a COMpointer and creating the instance then acessing the function of a dll...
The comparison doesn't make sense, since a COM server may reside in a DLL. That DLL exposes at least two functions: DllRegisterServer() and DllUnregisterServer() that is called in order to register or unregister the COM server.
You cannot "create a COM pointer and call DllRegisterServer".
When you're calling ::CoCreateInstance() , or some equivalent, the server doesn't have to be located inside a DLL; it may be an out-of-process server that resides in an executable file (.exe).
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
I'm sorry to trouble everyone, I have a feeling this should be a simple answer but I'm missing something.
I need to take in from a Rich Edit Box on my dialog box a string which can be a string in Chinese, Japanese, English, German, etc.
I'm currently using this:
char TextArray[SIZE]={0};
m_RichEditBox.GetWindowText(TextArray, SIZE);
When I encounter a Multi-char string (like the Chinese or Japanese ones), the string TextArray is filled with "????" instead (Yes, Question marks, in case you thought you saw wrongly)
I have tried to declare TextArray as a
TCHAR , tried to convert it to a wchar , tried to declare as a CString, but so far nothing has worked.
I have checked, I do not have _UNICODE declared, and since _MBCS is default in VC6, shouldn't I get some result instead of "????" ?
Or is my problem the fact I'm using VC6?
Thanks in advance, and if you need more info, feel free to ask.
Jeffrey
|
|
|
|
|
Hi Jeffrey,
I would like to ask you a few questions.
- If you want to process Japanese or German text (Unicode?!), why do you do an _MBCS build?
- Are you able to type in German text in the Rich Edit control?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Hi Rajesh
Aren't Japanese, Chinese and Korean Double byte and thus MBCS?
I read this page and many others that led me to think so:
[^]
My main focus are the Asian text for now. If I need Unicode for German, then I'll do another program for it later, I'm sorry for the confusion and perhaps my lack of understanding on it.
Are you telling me I should do a unicode build to handle both double byte and other non-double-byte text?
I can cut and copy any text I can get on Wordpad into my Rich Edit Control with no problems, but I cannot seem change my language settings when my program is in focus and is the main window, thus I cannot type directly into the rich edit control. Does this help to diagnose my problem?
Thanks
|
|
|
|
|
JJeffrey wrote: My main focus are the Asian text for now. If I need Unicode for German, then I'll do another program for it later, ...
But why welcome pain? Won't a Unicode build solve your problem? Perhaps I'm not understanding your requirements or something like that...
But I just opened VC6, created a dialog based app with a rich edit control (CRichEditCtrl) on it and then did a Unicode build. The first time, I wasn't able to copy or type in Japanese into the rich edit control, even though I've got the language installed on my machine and it displayed ????.
I then remembered it was the old cow-doo with VC6 which requires a manual hack, and opened the .RC file of the project in a text editor to find this particular piece of code:
CONTROL "",IDC_RICHEDIT1,"RICHEDIT",ES_AUTOHSCROLL | WS_BORDER |
WS_TABSTOP,60,83,150,61 which I replaced with
CONTROL "",IDC_RICHEDIT1,"RICHEDIT20W",ES_AUTOHSCROLL | WS_BORDER |
WS_TABSTOP,60,83,150,61
A new build and off I go with my app ready to handle Japanese and German Unicode text.
JJeffrey wrote: Aren't Japanese, Chinese and Korean Double byte and thus MBCS?
I suggest that you read up on Unicode. From the link you gave me:
Note: New Windows applications should use Unicode to avoid the inconsistencies of varied code pages and for ease of localization.
Hope that would help.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Maybe I'm just too embedded into the notion that Unicode is Unicode, MBCS is MBCS and never the twain should they meet... Guess that idea is obsolete now.
I tried the "hack" with my MBCS build but nothing changed. I'll take some time to convert to a Unicode build and try again.
Thanks for your time and sorry for fustrating you.
|
|
|
|
|
JJeffrey wrote: I'll take some time to convert to a Unicode build and try again.
I'd very strongly recommend that you do it.
JJeffrey wrote: Thanks for your time and sorry for fustrating you.
Me frustrated? Not at all.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Thanks, my problem is resolved, though now I need to iron out the bugs that appeared due to my hasty switchover to Unicode. I'll start building my programs using Unicode from the start next time.
Thanks again.
Jeffrey
|
|
|
|
|
JJeffrey wrote: I'll start building my programs using Unicode from the start next time.
That's wise!
JJeffrey wrote: Thanks again.
My pleasure, and glad to be of help.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
i can't use my local msdn library after i installed it with VS2008.
it says can't find the server. i save a screenshot here:msdn_error1.bmp.html[^]
but i don't know why. And the problem still there even though i reinstall msdn
|
|
|
|
|
I am not sure if i understood your problem correctly.
Are you facing some problem with associating MSDN with VS2008?
If yes there should be some option to associate in settings of VS2008.
At least it is there is VS6.0 under Tools->Options->Help System. so you can try to find in VS2008.
I hope it helps.
Regards,
Sandip.
|
|
|
|
|
did you see the image of my error screenshot? You know, when you press F1 in VS editor, the helper process(MSDN) will be started automately. Of course you can select to start it from the programs menu.
My problem is that, the helper can't show any useful documents although it has been started successfully.
Thanks
|
|
|
|
|
kcynic wrote: did you see the image of my error screenshot?
No site is blocked in my office
kcynic wrote: when you press F1 in VS editor, the helper process(MSDN) will be started automately
If it starts automatically then it is associated properly.. I just guessed that it might be problem when you install VS and MSDN separately.
Regards,
Sandip.
|
|
|
|
|
I really don't know why. if so, im afraid i'll have to use msdn online, until i reinstall my os when some fatal errors occur on it.
Thanks all the same.
|
|
|
|
|
It works well now!
I just simply updated my IE to IE8.
Thanks.
|
|
|
|
|
Hello,
I am trying to draw a video stream from a webcam or from another computer webcam on a Direct X surface. Can anyone give me some suggestion about any library or SDK I can use to do that. I know the part how to put a bitmap data on the Direct X surface, but need some suggestion about getting video data from the webcam and from the network.
Thanks!
Nacho
|
|
|
|
|
You can use windows media encoder to get the desire result . Also you must read directshow which having all the functionality of streaming and drawing on directx surface
Rajesh
|
|
|
|
|
Hi everyone,
I am facing some issues when i am porting my code from VC++6.0 to VC++9.0. Here is the list.
1. ByteVector::iterator it = (BYTE *)"ACI";
2. Error 3 error C2440: 'initializing' : cannot convert from 'BYTE *'
to 'std::_Vector_iterator<_Ty,_Alloc>'
hdr = *(ACI_HEADER *)it;
hdr is of type ACI_HEADER.
I tried de coupling the iterator and the ACI_Header but it dosent work.
hdr = (ACI_HEADER)(*it). This type of decoupling worked for unsigned char conversions but not
ACI_HEADER.
3. Error 17 error C2664: 'ComPtr<T>::ComPtr(const ComPtr<T> &)' : cannot
convert parameter 1 from 'int' to 'const ComPtr
ComPtr<CEventMsg> CEventMsg::FromBuffer(DataBuffer &buffer)
{
.....
.....
return NULL;
}
Any advices on these issues will be helpfull.
Thanks,
Pratap
|
|
|
|