|
I have a set of C++ static libraries that is released as part of my product, and used by other developers to build their applications. Someone using these libraries is gettings an error linking in debug mode (missing debugging information for referencing module) which only occurs when the separate types linker option is turned off - when it is on the program links successfully.
Does anyone know how to resolve this so that linking can still be done successfully in debug mode without having to use separate types? Do I need to distribute the .pdb files along with the static libraries or something like that?
Dave
http://www.cloudsofheaven.org
|
|
|
|
|
I'm not entirely sure, but I think your problem lies in the fact that you need to produce separate static libraries built to link to the various types of run-time libraries (static and dynamic).
You need to produce a library with different warts for each of the different linker options (/MD /MDd /ML /MLd ) and Unicode options if applicable.. This makes about 8 libraries you need to compile for completeness.
It's a real pain... however you can make it so the users of the libraries are not too inconvenienced by using the #pragma comment(lib, libraryName) compiler directive.
Good luck.
//.ichael
|
|
|
|
|
If I have, say:
typedef enum<br />
{<br />
val1 = 0,<br />
val2 = 1,<br />
val3 = 5<br />
} MyEnum;
Is there any programatic way I can find out how many constants MyEnum contains, what their highest and lowest values are, etc?
I assume not, but I live in hope
|
|
|
|
|
I don't think there is.
Afterall, what you are doing is defining a new enumeration type, which grants a value to certain types of selections. So a MyEnum type can only contain three possible values.
But as you require the definition of the enumeration type in order to use it anyhow, then how come you can't check the definition itself which of the values is the highest or lowest ?
Naturally, you could check the size of the enumeration structure, but I believe it would return a value of no significant meaning. I have never tested.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Antti Keskinen wrote:
Naturally, you could check the size of the enumeration structure, but I believe it would return a value of no significant meaning. I have never tested.
It'll be sizeof(int) or sizeof(short) (I *think* it's supposed to be sizeof(int), but I'm not 100%, and I know some compilers allow one to make enums 16 bit)
--
I am perpetual, I keep the country clean.
|
|
|
|
|
You want C#, it adds exactly these things to the language, and more ( i.e. more for enums ). But in C++, the answer is, no. The best you can do is end each enum with an element called ItemCount, or something. It will then hold the number you want, as the list is 0 based.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
No, the standard way of doing this is something like
enum MyEnum
{
meVal1 = 0,
meVal2 = 1,
meVal3 = 5,
me__MinVal = 0,
me__MaxVal = 5,
me__Count = 3
};
Otherwise, enums are just slightly typed constants. They aren't a particularly solid type (like in pascal), but is does have its advantages.
//.
|
|
|
|
|
The way I've always done this is:
enum MyEnum {
val1 = 0,
val2 = 1,
val3 = 5
MyEnum_min = val1,
MyEnum_max = val3,
MyEnum_cnt = 3
};
Software Zen: delete this;
|
|
|
|
|
In an effort to use a specific printer I am using OpenPrinter with the printer name. When this call is made using most of the printers I have access to it works fine. However, if the named printer happens to be an HP printer, OpenPrinter() returns 1801 (INVALID_PRINTER_NAME). The name is the correct name from the installed printers on the system.
Does anyone have any idea what's going wrong?
|
|
|
|
|
What OS?
For NT, XP and 2000 it seems to want the PRINTER_DEFAULTS.DesiredAccess to be set to READ_CONTROL || PRINTER_ACCESS_USE
'--8<------------------------
Ex Datis:
Duncan Jones
Merrion Computing Ltd
|
|
|
|
|
I'm using XP. I'll give this a try. Thanks.
|
|
|
|
|
the DesiredAccess flag made no difference. I still got an 1801 error back from 'GetLastError()' after OpenPrinter failed. This only happens with HP printers. All others seem to work fine.
|
|
|
|
|
How can I merge the string table of 2 resource file automatically. For example I have a main resource(main.rc)with default string table entries and a second resource(temp.rc)with extra string table entries. I added the #include "temp.rc" into the main.rc. but it doesn't add it. Any ideas?
Thanks
|
|
|
|
|
Open the two .rc file in one vc ide, select the strings that you want to append and then drag n drop in the target table.
this will do the trick.
hope it helps.
I Touched Osama Bin Ladens Bushy Beard
|
|
|
|
|
Anthony9887 wrote:
I added the #include "temp.rc" into the main.rc. but it doesn't add it.
Do you get a compiler error? This is normally not an issue as there is already a #include for a .rc2 file that AppWizard creates for you. It shouldn't be any different than that.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
hai ,
How to get the user name of the currently logged on
users of all computers on the network and how to implement it in VC++ using MFC ?
Pls mail me if You have any ideas.
thanks.
jak
|
|
|
|
|
In win2k you have the environment varible username that containts the name of ther user that has logged in,
In dos if you type set and enter you will find lot of other information releted to user profile and other stuff.
Regards,.
I Touched Osama Bin Ladens Bushy Beard
|
|
|
|
|
projectjak wrote:
How to get the user name of the currently logged on
Use NetWkstaUserGetInfo() . I would refrain from using environment variables for this as they can be set, unset, reset at any time.
projectjak wrote:
users of all computers on the network and how to implement it in VC++ using MFC ?
While it has nothing to do with MFC, I think NetUserEnum() is what you want.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Hi,
I'm having problems importing and using a WAV file within my MCF project.
IN VC++ 6, I went to the resource tab and imported the WAV file. I can actually see the declaration of the resource in the .rc file
But when I use FindResource(), this function does not find it so it returns NULL.
-- Here is the declaration in the .rc file:
IDR_WAVE1 WAVE DISCARDABLE "res\\ring1.wav"
-- Here is how I'm trying to find that resource:
HRSRC hResInfo;
HINSTANCE Nl=AfxGetInstanceHandle();
hResInfo = FindResource(Nl,"IDR_WAVE1","WAVE");
It seems that it finds the type "WAVE" but not the resource name "IDR_WAVE1" because the error returned by GetLastError() is the 1814 = No resource name found.
I appreciate any hint or suggestion. Thank you in advance.
R.B.
|
|
|
|
|
|
Hi all,
i was browsing through the windows DDK when i found a page about volatile and non-volatile cpu registers for the x86-64.
is there an equivalent for the x86?
greez,
Alexander M.
Don't try it, just do it!
|
|
|
|
|
Can you elaborate what are volatile registers???
I Touched Osama Bin Ladens Bushy Beard
|
|
|
|
|
e.g EAX is a volatile register, which ESI and EDI are non-volatile.
Don't try it, just do it!
|
|
|
|
|
humm, well if i apply the same analogy i would say that
in 8086 ax is volatile and si,di is non volatile....
frankly i am sorry i cant give good answer to this.
sorry.
Prakash.
I Touched Osama Bin Ladens Bushy Beard
|
|
|
|
|
I'm trying to delete the contents of a file, but not the entire file. I want to keep the size of my log file down; and hence, remove older data from the file. I was thinking of reading the contents into a string class and then delete the file. Then, I would split the string (hence, removing older data) and writing the file again. This seems like a lot of trouble. Is there a better way to do this?
|
|
|
|