Click here to Skip to main content
16,005,491 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi all again.

I have read the articles by Karpov Andrey, but I would like more indepth pointers in regards to what not to use.
Example MSDN says that you should use DWORD_PTR / UINT_PTR / INT_PTR instead of DWORD / UINT / INT
and SetClassLongPTR and such.
Is there anything else I should start doing?
Like data types to avoid and those to use instead?

I am using VS2010 and I have the PVS-Studio trial installed. Are there any decent x64 static code analyzers?

Thanks in advance.
Posted
Updated 25-Jun-11 15:37pm
v2

In addition the the library and what Espen says:

All three instruction-set architectures are incompatible in the sense that none two of them cannot be used is one process. I explain those architectures and compatibility aspects here:

How to use 32 bit DLL in 64 bit machine configuration.[^].

Microsoft Dependency Walker can help a lot, see http://en.wikipedia.org/wiki/Dependency_Walker[^], http://www.dependencywalker.com/[^].

—SA
 
Share this answer
 
Comments
ryan20fun 26-Jun-11 2:18am    
ok, will look at that.
so i maybe using 32bit and 64bit code together ?
doesnt the 64bit version get used instead ?
Sergey Alexandrovich Kryukov 26-Jun-11 11:31am    
This is your choice bases on the considerations I explained.
The rule is: one process should be either x86 and use all x86 libraries, or it should be of instruction set architecture if your system (Itanium or x86-64, you have no choice here, only one of them), then all libraries should match.

The application can be of more then one process, working via IPC (say, via COM/DCOM), then each process should follow this rule, but some processes could be x86 (32-bit) and some of whatever*-64.

You choice depends on availability of all components for selected instruction-set architecture -- some may not be available for some architecture.
--SA
Espen Harlinn 26-Jun-11 4:37am    
Good point - my 5
Sergey Alexandrovich Kryukov 26-Jun-11 11:25am    
Thank you, Espen.
--SA
Karpov Andrey seems to have covered most of it.

Just check that your solution does not require you to link against 32-bit only libraries; or has any other 32-bit interoperability requirements that will cause you a lot of grief.

Good luck,
Espen Harlinn
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 25-Jun-11 18:49pm    
I agree, this if most important, my 5.
Please see my solution on compatibility; MS Dependency Walker is a good tool.
--SA
Espen Harlinn 26-Jun-11 4:35am    
Thank you, SAKryukov!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900