How to statically linking 2 files for 32 bit and 64 bit in VC++ 2005

I am trying to statically link a xyz.lib file to my 32-bit VC++ 2005
MFC app in order to use a .sys file.

I have two xyz.lib files, one for win32 and one for amd64.

I know I should add the .lib file to ['Property Pages' > 'Linker' >
'Input' > 'Additional Dependencies']

But which file do I add, how do I add both files, and how do I ensure
the 32-bit app can use the linked .sys on 32-bit as well as 64-bit?

Thanks!

0
10/25/2007 10:07:36 PM
vc.mfc 33608 articles. 0 followers. Follow

6 Replies
638 Views

Similar Articles

[PageSpeed] 43

Hi,

Just use the 32 bit lib, your app will run on 64 bit via WOW64.

64 bit development would involve setting up a new cpu platform, which has 
it's own copy of build configuration settings.  Requiring potential porting 
all your code to compile as 64 bit.  Which then won't run on 32 bit.

You generally can't mismatch 32 and 64 bit binaries within an app.

best regards,

Robert Dede
Gigasoft, Inc.
www.gigasoft.com





<pranab.salian@gmail.com> wrote in message 
news:1193350056.887779.144190@i13g2000prf.googlegroups.com...
>I am trying to statically link a xyz.lib file to my 32-bit VC++ 2005
> MFC app in order to use a .sys file.
>
> I have two xyz.lib files, one for win32 and one for amd64.
>
> I know I should add the .lib file to ['Property Pages' > 'Linker' >
> 'Input' > 'Additional Dependencies']
>
> But which file do I add, how do I add both files, and how do I ensure
> the 32-bit app can use the linked .sys on 32-bit as well as 64-bit?
>
> Thanks!
> 


0
robert8450 (10)
10/25/2007 11:19:28 PM
In article <OP-dnU8C0oQXubzanZ2dnUVZ_uiknZ2d@giganews.com>, "Gigasoft" <robert@gigasoft.com> wrote:
>Hi,
>
>Just use the 32 bit lib, your app will run on 64 bit via WOW64.
>
>64 bit development would involve setting up a new cpu platform, which has 
>it's own copy of build configuration settings.  Requiring potential porting 
>all your code to compile as 64 bit.  Which then won't run on 32 bit.
>
>You generally can't mismatch 32 and 64 bit binaries within an app.

There isn't enough advantage to even consider going 64 bit.
A few percent improvement in performance at a risk breaking
things up completely.

-- 
The most powerful Usenet tool you have ever heard of.
NewsMaestro v. 4.0.2 has been released.

Multi-job support and other important feature additions
and various improvements and optimizations.

Web page:
http://newsmaestro.sourceforge.net/

Download page:
http://newsmaestro.sourceforge.net/Download_Information.htm

0
almond1 (17)
10/26/2007 12:00:55 AM
You would have separate directories for 32-bit and 64-bit libraries, or you would name the
libraries with different names, such as xyz32.lib and xyz64.lib.

You would have different build configurations for the 32-bit and the 64-bit values that
named the appropriate directories.  Note that you can use common facilities if you use the
macro capability available for naming paths.

A .sys file is a device driver, and it would not have a .lib file.  It is not even part of
anything a user-level module would have anything to do with.

You do not build device drivers (.sys files) with Visual Studio, you build them using the
DDK build environments.

Please clarify what a .sys file has to do with any user-level code or Visual Studio at
all.
				joe



On Thu, 25 Oct 2007 15:07:36 -0700, pranab.salian@gmail.com wrote:

>I am trying to statically link a xyz.lib file to my 32-bit VC++ 2005
>MFC app in order to use a .sys file.
>
>I have two xyz.lib files, one for win32 and one for amd64.
>
>I know I should add the .lib file to ['Property Pages' > 'Linker' >
>'Input' > 'Additional Dependencies']
>
>But which file do I add, how do I add both files, and how do I ensure
>the 32-bit app can use the linked .sys on 32-bit as well as 64-bit?
>
>Thanks!
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15972)
10/26/2007 3:37:49 AM
It's more than "a few percentage points".  I did some performance measurement of
compute-bound code, and a Win32 app that does no kernel calls but runs a compute-intensive
loop exectutes in n units of time, and the identical code compiled for 64-bit runs in
0.75*n units of time, consistently, for several different kinds of loops, both integer and
floating point loops.
				joe

On Fri, 26 Oct 2007 00:00:55 GMT, almond@brothers.orgy (Almond) wrote:

>In article <OP-dnU8C0oQXubzanZ2dnUVZ_uiknZ2d@giganews.com>, "Gigasoft" <robert@gigasoft.com> wrote:
>>Hi,
>>
>>Just use the 32 bit lib, your app will run on 64 bit via WOW64.
>>
>>64 bit development would involve setting up a new cpu platform, which has 
>>it's own copy of build configuration settings.  Requiring potential porting 
>>all your code to compile as 64 bit.  Which then won't run on 32 bit.
>>
>>You generally can't mismatch 32 and 64 bit binaries within an app.
>
>There isn't enough advantage to even consider going 64 bit.
>A few percent improvement in performance at a risk breaking
>things up completely.
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15972)
10/26/2007 3:39:43 AM
<pranab.salian@gmail.com> wrote in message 
news:1193350056.887779.144190@i13g2000prf.googlegroups.com...
>I am trying to statically link a xyz.lib file to my 32-bit VC++ 2005
> MFC app in order to use a .sys file.
>
> I have two xyz.lib files, one for win32 and one for amd64.
>
> I know I should add the .lib file to ['Property Pages' > 'Linker' >
> 'Input' > 'Additional Dependencies']
>
> But which file do I add, how do I add both files, and how do I ensure
> the 32-bit app can use the linked .sys on 32-bit as well as 64-bit?

By .sys, do you mean a driver?  You cannot have 32-bit drivers on 64-bit 
Windows.  The .sys needs to match Windows, the .lib needs to match your 
application.  If they are well-designed they will automatically handle the 
case of a 32-bit .lib with a 64-bit .sys.

>
> Thanks!
> 

0
rbv (46)
10/26/2007 5:36:16 PM
But a .sys file, if it is a driver, will NEVER have a .lib file because this makes no
sense whatsoever!
				joe

On Fri, 26 Oct 2007 12:36:16 -0500, "Ben Voigt [C++ MVP]" <rbv@nospam.nospam> wrote:

>
><pranab.salian@gmail.com> wrote in message 
>news:1193350056.887779.144190@i13g2000prf.googlegroups.com...
>>I am trying to statically link a xyz.lib file to my 32-bit VC++ 2005
>> MFC app in order to use a .sys file.
>>
>> I have two xyz.lib files, one for win32 and one for amd64.
>>
>> I know I should add the .lib file to ['Property Pages' > 'Linker' >
>> 'Input' > 'Additional Dependencies']
>>
>> But which file do I add, how do I add both files, and how do I ensure
>> the 32-bit app can use the linked .sys on 32-bit as well as 64-bit?
>
>By .sys, do you mean a driver?  You cannot have 32-bit drivers on 64-bit 
>Windows.  The .sys needs to match Windows, the .lib needs to match your 
>application.  If they are well-designed they will automatically handle the 
>case of a 32-bit .lib with a 64-bit .sys.
>
>>
>> Thanks!
>> 
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15972)
10/27/2007 2:57:06 AM
Reply:

Similar Artilces:

Users of Apple Mail getting meeting requests as web links.
Apple Mail users of my Exchange server get invites as web links to the Exchange Web Access interface instead of .ics files. Can anyone point me to what setting I need to change in Exchange to make them be .ics files again? --Sterling Anderson ...

importing publisher files
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel I have many publisher 2003 project files I would like to use, but have not found away to import them into office 2008. Any suggestions on how to convert them to a use able format? lckid@officeformac.com wrote: > Version: 2008 > Operating System: Mac OS X 10.5 (Leopard) > Processor: Intel > > I have many publisher 2003 project files I would like to use, but have not found away to import them into office 2008. Any suggestions on how to convert them to a use able format? Hi The conversion has to be done u...

How to call a non static function from a static function
Hi I need to go to a non static function from a static function?can anybody suggest me how to do it?any kind of help will be greatly appreciated. You need to pass the object whose function you want to call. static void s_foo( A* a ); class A{ public: A(); ~A(); void funcA(); }; main() { ... A a; s_foo(&a); } static void s_foo( A* a ) { a->funcA(); } -Seetharam ...

Outlook 2003, import UNIX mail files from Mozilla Mail?
Is there a way to import UNIX mail files from Mozilla Mail into Outlook 2003? ...

Linking Files
I am having problems linking files into a newsletter. I have figured out how to attach the files, but when I go to change the icon, it doesn't seem to want to put the icon I select onto the newsletter. Am I doing something wrong? Thank you!! Your question is unclear. Is your newsletter a web document? Are you trying to link files to your web page? Is your newsletter a print document that you are trying to email? What do you mean when you say "change the icon" or "put the icon I select onto the newsletter"? Which version of Publisher are you using? DavidF &qu...

How to make a sys file
Hello: .sys files are driver files. How to make a .sys file? can anyone help me in this regard? let i have to make a .sys file for cd-rom. replay thnx download the driver development kit from ms and start reading a lot. "Raed Sawalha" <raed_sawalha@hotmail.com> wrote in message news:uH6vCF8oEHA.3876@TK2MSFTNGP15.phx.gbl... > Hello: > > .sys files are driver files. How to make a .sys file? can anyone help me > in this regard? > let i have to make a .sys file for cd-rom. replay > thnx > > Start here http://www.osronline.com...

Email Link
First as always, I want to say thanks for those that contribute especially the MVP's. Windows XP Home sp2 Office '03, had '07 beta but I uninstalled and reinstalled '03 Hi, I recieved an email from a wanted source. In the body there was an eamil address hyperlinked with a different address underneath. It was from the same company so I am not worried about anything there. The problem is I have had this in the past and do not know if the hyperlink was a different address. Meanwhile back at the ranch, when I click on the email address 45+ Browser windows proceeded to open...

link colors
I am creating an HTML e-mail to send via Outlook. When viewed with Internet Explorer the link colors look correct, but when imported into Outlook or Outlook Express, they are vastly different. I made sure I was using web-safe colors, but no change. The web version is at http://www.goldthread.com/gtad.html What I want is for the ad to approximate the look of my website, www.goldthread.com. If anyone wants to work with me on this I can send a version by e-mail. Thanks, Steve S. Steve S. <ssake@goldthread.com> wrote: > I am creating an HTML e-mail to send via Outlook. When viewed...

Static CMap object
Hi all, I've declared in my .h file the following CMap type : typedef CMap<CString, CString&, MyClass*, MyClass*&> Map; ... ... class AnotherClass { ... public: static TrainBuilderMap BuilderMap; ... ... static void Register(CString name, MyClass* instance); }; In one of my CPP file call the Register method as following: AnotherClass::Register(_T("TEST"), this); The code of Register method is : void AnotherClass::Register(CString name, MyClass* instance) { AnotherClass::BuilderMap.SetAt(name, instance); } When linking my project there the following linker error :...

Picture Control #2
Hello, I got a Picture Control with a bitmap. I added a second bitmap to my ressources and now I want to switch between those two bitmaps. What do I have to do? SetBitmap and LoadBitmapA do not take the ressource-ID as parameter. Greetings Sven "Sven Eichenm´┐Żller" <sven@eichenmueller.de> ha scritto nel messaggio news:fubapu$o6a$02$1@news.t-online.com... > SetBitmap and LoadBitmapA do not take the ressource-ID as parameter. You can create instances of CBitmap class, and use LoadBitmap method to associate the CBitmap instance to a particular bitmap resource. Note tha...

Bizarre Behavior in Excel #2
Often now when I open an Excel 98 for MAC spreadsheet my date fields all display #####. I know it is supposed to be the indication that the column is too small. However, in the formula bar the contents are now shown as the old Lotus timeline value, e.g. 35237. When I attempt to format the cell using the Format/Cells/Date format it has no effect. If I try to enter a new date such as 1/5/05 (even in new cells), Excel does not automatically recognize it, and instead just treats it like a text string. Also, another thing that happens is that my spreadsheets will open with a number of initial ...

local variable inside static method
Hi all, I thought local variable inside static method is implicitly static but my test with threading say otherwise. Why is so? I had always been taught to declare the variable near its usage, but it is simply not so with static method. I think... static void StaticMethod() { string[] onetwothree = new[] { "one", "two", "three" }; // use onetwothree variable... } would be more elegant than static string[] onetwothree = new[] { "one", "two", "three" }; static void StaticMethod() { // use onetwoth...

linking to formula template on different tab
I don't know if I can do this in Excel, but thought it worth asking. I have a list of 80 clients. I need to know the cost for them, which is a complicated, multi-step calculation. I enter 4 input #s into the calculation (50, 17, 0, 23), and out pops the results: $22,123, $33,123, 0, $99,123. (I created the multi-step calculation formula, btw) However, the #s for the clients change regularly. So now I need to enter my new set of #s (45, 17, 2, 28) in order to get the updated cost figures. And I need to do this for all 80 clients, every time. In addition, I often need ...

Lost Formatting #2
We have several Excel files that were created with either Excel 2000 or 2003. We are now working on these files in 2007. We continue to have problems with the files losing formatting. We will change font color, font size, cell formats, etc. We save the file but when we re-open the file all of the revisions that we saved are gone. What can we do to these files to get them to keep their formatting? Are you saving them in Excel 2007(XLSX) format? Theresa wrote: > We have several Excel files that were created with either Excel 2000 or 2003. > We are now working on these files in 200...

2 Quick Questions #2
Hi: 2 Quick Ones: I thought I had read that with Exchange 2003, clients are automatically redirected tot he correct Exchange server when they are migrated. I am finding that this is not the case. I have also noticed that once a mailbox is migrated, and says it is successful, I cannot access that mailbox immediately. It appears that AD needs to replicate before I am able to do so. Is this correct? Thanks Profiles should be migrated automatically although sometimes it does not work. Try this: http://www.microsoft.com/downloads/details.aspx?FamilyId=56F45AC3-448F-4CCC-9BD5-B6B52C13B...

linking Excel table to word
Can anyone tell me how I can have an excel table linked to a word table so that the word table dynamically updates itself based on the values in excel cells? Much appreciate it if anyone can point me to direction Thrava Hi in MS Word just insert the Excel sheet as Excel object (Edit - Paste Special) -- Regards Frank Kabel Frankfurt, Germany "Thrava" <anonymous@discussions.microsoft.com> schrieb im Newsbeitrag news:0cea01c46e91$faae80b0$a501280a@phx.gbl... > Can anyone tell me how I can have an excel table linked to > a word table so that the word table dynamically u...

Microsoft CRM to slow and static?
Hello, please help me! We are evaluating microsoft Dynamics CRM 4.0 over here. My first impression was very positive but at the moment I'm frustrated. I'm finding myself often with 5 or 6 crm popups open. An example: Via workflow we are getting tasks in a pipeline. - I click on task "Call Contact" - The window Task Opens - There's a link opportunity - The opportunity window opens - I click on contact name - The contact opens - now i can see the phone number .... It looks like the developers have made forms for there entities but users need centralised informations wh...

Visio 2003, Database linking, Space Plans
Visio 2003, or at least my lack of knowledge about Visio 2003 is driving me insane! I have what I thought would be a fairly simple project, that is turning into a nightmare. I would appreciate any help anyone could give about linking a database to a Visio 2003 space plan. Below I have outlined what I have, what I want, and what I've tried. If someone could point out where I am going wrong I would be really pleased. ***What I have*** 1. A SQL database which contains computer equipment assets. There is a main Asset table which contains a record for each asset along with some purchasing ...

Purchase Orders
Does anybody know of any RMS Add-On where you can Create a Purchase Order by importing an item list from a CSV text file? We have a customer that gets an excel spreadsheet from their supplier of all the items that they should be receiving via UPS. The customer doesnt know before hand what they will be receiving until they get the excel spreadsheet. Any Ideas? I'm new to RMS, so forgive me if this info is slightly inaccurate, try it out first. If you create a blank P.O for adding item manually, on the screen where you enter your items, right click, and import. Then you choose you...

Static
hi to all, How can i create a Static frame over the an owner draw button to use it with OnPaint thanks for help You could use the standard LineTo() call something like: http://www.codersource.net/mfc_tutorial_Part3.html Tom "mido1971" <mido1971@discussions.microsoft.com> wrote in message news:72FB9FAE-9ACB-4E75-835A-3E89EFAAD554@microsoft.com... > hi to all, > How can i create a Static frame over the an owner draw button to use it > with OnPaint > > thanks for help Create it as a child of the dialog and make its Z-order higher than the button. Perha...

Outlook is blocking most file types in attachments
Outlook appears to have blocked many file types that are received as attachments by assigning a Level 1 to them. Does anyone know how I could change some of the assignments from Level 1 to be unblocked or to be a Level 2 so that I can receive them? So far, the only thing I can find is that Microsoft Exchange Server allows it, but I do not use that product. Thank you, Linda ...

Item Receiving in IV10200 #2
We are experiencing the same issue except the difference in cost being assigned to the 1 item is dramatically different than the other units that are at the correct cost. Any idea where I should look to find a setup issue that might be causing this? Joel "Richard Whaley -- MVP 2006-2008" wrote: > This is by design to handle costs that cannot be evenly divided by the > quantity within the number of decimals defined. For example, if you purchase > 10 items and pay 11 cents total, ten will be received at one penny and one at > two pennies (assuming that only 2 dec...

Open Office #2
Can anyone advise how they've found Open Office and whether it is worth using, particularly for Excel applications? Rob "rob nobel" <robnobel@dodoNOGOOBS.com.auNOGOOBS> wrote... >Can anyone advise how they've found Open Office and whether it is worth >using, particularly for Excel applications? Depends on what you're trying to do. OO Calc's array handling is much weaker than Excel's, so many (possibly most) of the trickier array formulas given in these Excel ngs won't work in OO Calc. But most of the other techniques work. OO Calc provides onl...

Office 2003 Recieving error with 2 Email accounts from Same Server #2
I'll try to describe this the best I can, First I'm running outlook 2003 with the service pack on windows xp sp2. Windows firewall is turned off as is my antivirus software is disabled while trying to get this to work (I even uninstalled it) I have two email accounts set up correctly (Two of my other co workers have the same exact set up and email accounts and they have no issues) on the same server i.e. email1@domain.com and email2@domain.com. When the send and recieve function is activated, the non default email account gets a recieve error as below Task 'EMAIL ACCOUNT - Rec...

copyright symbol #2
This may sound like a stupid question, but how do you keep Excel from inserting the copyright symbol when you enter "(C)"? Go to Tools > AutoCorrect Options, click on the entry for "(C)" and delete it. HTH Jason Atlanta, GA >-----Original Message----- >This may sound like a stupid question, but how do you keep >Excel from inserting the copyright symbol when you >enter "(C)"? >. > You can turn it off for good under tools>autocorrect and delete it (note that autocorrect changes are done for the whole of Office like Word etc) or yo...