|
Hey everybody!
I am looking for a while a way to disable _com_errors being thrown through COM, and only get the HRESULT (S_OK or something else...) with no luck (I don't want to catch the _com_error).
From what I understood it is an attribute to the #import directive, but I can't really find one that causes that action.
So, is there a way to #import a dll and the prevent _com_error, so I can simply check the HRESULT alone?
Thanks!
|
|
|
|
|
raw_native_types perhaps?
|
|
|
|
|
First, Thanks for your help!
but that attribute forces BSTR and VARIANT instead of _bstr_t and _variant_t.
It still throws _com_errors...
|
|
|
|
|
Hey,
I had a little mistake when before I wrote the other thread.
It Works! , cause it simply disables the smart pointers...
But with it, it takes the _bstr_t and _variant_t and and all the other good things of smart pointer...
Oh well, at least I know what to do!!!
Thanks again!
|
|
|
|
|
Hi all,
My project requires TFTP server implementation in vc++.
If anybody is having the article or any info please share it.
Thanks in advance.
Sunil.
Regards,
Sunil Kumar
|
|
|
|
|
sunilkumar.d wrote: TFTP
Do you mean T errorist F inance T racking P rogram [^]?
BTW: Have a look at this page .
BTW2: You don't know we've also an article search engine, do you [^], [^]?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
modified on Tuesday, July 22, 2008 4:30 AM
|
|
|
|
|
Hi Pallini,
Thanks for the reply.
I already searched it in articles section, but nothing related I found.
Anyway I will do it again.
Thanks again.
Regards,
Sunil Kumar
|
|
|
|
|
I've developed a project in VC++ 2005. It works in Release mode. When I compile this project in Debug mode, I got many errors which states,
error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall dtAnim::CharacterWrapper::SetGroundClamp(class dtCore::Scene *,float)" (__imp_?SetGroundClamp@CharacterWrapper@dtAnim@@QAEXPAVScene@dtCore@@M@Z) referenced in function "public: __thiscall dtAI::AICharacter::AICharacter(class dtCore::Scene *,class dtAI::Waypoint const *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned int)" (??0AICharacter@dtAI@@QAE@PAVScene@dtCore@@PBVWaypoint@1@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@I@Z)
What to do to Compile and Run my project in Debug mode?
|
|
|
|
|
You probably forgot to link to a library file in the project options for the debug mode. Where does the class CharacterWrapper come from ?
|
|
|
|
|
It's from an external tool. I've included all the libraries mentioned in the guidelines for this tool. How can I find out which library is missing and where do I link that particular library?
|
|
|
|
|
Open the project settings for the release version and check in the linker category. There should be somewhere an option "Additional Dependecies" in the "Input" category (well, that depends on which IDE you are using). Check if the debug mode uses the same libraries as the release mode.
|
|
|
|
|
I have loaded a bitmap to a dialog.
But that bitmap contains white background and it looks odd in the dialog.
I need to match bitmaps background with dialogs menu (grey) color.
How to do this?
|
|
|
|
|
|
The technical word for Making bitmap background invisible is MASKING...
if ur using white color as Bitmap background then
Use below function to change it to backGround color
ColorTo( RGB(white),RGB(BkGroundColor));
Search in an MSDN for this concept and also follow the code
// Create a Bitmap object from an image file
Bitmap myBitmap = new Bitmap("Grapes.gif");
// Draw myBitmap to the screen
e.Graphics.DrawImage(
myBitmap,
0,
0,
myBitmap.Width,
myBitmap.Height);
// Get the color of a background pixel
Color backColor = myBitmap.GetPixel(1, 1);
// Make backColor transparent for myBitmap
myBitmap.MakeTransparent(backColor);
// Draw the transparent bitmap to the screen
e.Graphics.DrawImage(
myBitmap,
myBitmap.Width,
0,
myBitmap.Width,
myBitmap.Height);
|
|
|
|
|
|
I am writing a structure of 20 bytes in to a file. Whenever I run the application I want to capture the last set written into the file. I used SeektoEnd () but of no use. How can I capture the last set (all 20 bytes of the structure) from the file?
|
|
|
|
|
i think i you open that in binary type, you should be able to do CFile::Seek(-20, CFile::end);
|
|
|
|
|
jasmine_123 wrote: How can I capture the last set (all 20 bytes of the structure) from the file?
FileObj.Seek( -20, CFile::end );
FileObj.Read(...);
|
|
|
|
|
Hi,
How do I find the 'Country Code'(or Localisation Code) of a Computer that my software tries to run on. As part of DOS 6.00 a long list of Country and Language Codes was published by Microsoft. I assume that these codes are still valid. I issue User Licences for my Software, and want to place geographical restrictions on the licence.
Regards,
Bram van Kampen
|
|
|
|
|
this might be a starter - http://www.lingoport.com/gi/help/gihelp/unsafeMethod/winlocalefunc.htm[^] see in-particular ...
"GEOID
GEOID is the Win32 geography identifier that defines the country or location where the user lives. It is only supported on Windows XP, Windows Server 2003, and Windows ME (though not Windows 2K). The setting can be changed via the Regional Options tab of the Regional And Language Options property sheet."
(There may be an equivalent for W2K, I havnt seen it yet)
Have you also thought about matching up their public tcp/ip address to one of those services that know where the endpoint is located ?
(My thoughts are that the locale, and yes, even the TCP/IP address may be changed, so you may need one or two methods to be able to determine location)
'g'
|
|
|
|
|
Exelent! Exactly what I was looking for. The matching of TCP/IP addresses has one problem, my software does not require an internet connection. (the software is for essentially a Cash Register).
The Software is currently not being licenced for use outside the UK and Ireland, but, if somebody in France wants to circumvent this by switching locale, on their heads be it! For Now, I jiust want to check for the English(UK) locale.
Many Thanks,
Bram van Kampen
|
|
|
|
|
Hi,
Your reply gave me a massive number of links, and my problem is Sorted. The documentation and tests about GEOID however suggests that it will not work until GEOID is set by a User App. (Smart thinking Mr Gates, New Feature, Let all users fill in the details over time)
What suits me for now is to determine the Lanmguage, and the Time Zone.
Just for your own reference,
Regards,
Bram van Kampen
|
|
|
|
|
Hi,
I want to be able to dynamically load a library dynamically. Easy right? Just use LoadLibrary(). The problem is that I want to be able to load the library into separate memory spaces each time (e.g. I don't want each loading instance to share the same global variables). Calling LoadLibrary() twice within the same process just returns you back the same handle.
Any help would be greatly appreciated.
Thanks.
|
|
|
|
|
You don't. Trying to load a DLL that's already present simply ups a reference count.
Steve
|
|
|
|
|
Seems like you need to put those variables in class.
-Saurabh
|
|
|
|