I know that with C I can ifdefine to run a program in comparability depending on the os. I don't think it is possible but I wanted to ask a community of more adept users if I can do the same with a dll. I would like my dll to bind with another a process but to bind with the correct bits? Please keep in mind I have only been working with programming for about 4 months with C++.
Asked
Active
Viewed 210 times
-1
-
3No you can not make a dll that is both 32 and 64 bit at the same time however its pretty easy to build the same source code for a dll in 32 and 64 bit mode so you really do not need this. – drescherjm Dec 06 '14 at 05:26
-
Yes I was just hoping that i could make as few files as possible. As a learning toy practically. I am placing most of my code in the dlls and calling them from a parent. A major project I'm trying to start is to change the window snaps to 1/4 instead of half screen. As they say go big or go home :) – TheStart101 Dec 06 '14 at 05:33
1 Answers
0
I would like my dll to bind with another a process but to bind with the correct bits?
The answer could be using out-of-process COM server. There is a related answer: Utilizing a 32-bit DLL in a 64-bit process via COM

Community
- 1
- 1

Alexander V
- 8,351
- 4
- 38
- 47
-
1In this case it's still a 32-bit DLL, but Windows runs it in the 32-bit subsystem (the same way that 64-bit Windows can run 32-bit .exe files) and they communicate via RPC. This works for COM DLLs because COM includes a messaging layer, however it won't work for generic DLLs. – M.M Dec 06 '14 at 21:53
-
I meant interoperability 32/64. Who cares if the marshalling is doing its job? – Alexander V Dec 06 '14 at 22:25
-
Creating a COM DLL is difficult, especially if not using MSVC. I'm not aware of any free tools that have all the right boilerplate code, and it's beyond most people's experience to write one from scratch. – M.M Dec 06 '14 at 22:56
-
1Well, to me ATL-technique (especially, integrated to VS) came as a revelation some... more than 10 years ago and now I even use Qt's QAxObject-based import with dumpcpp utility but still need ATL from time to time 'cause the rest of tools is just pathetic. Or maybe .Net COM server (if that is simpler, never done so). – Alexander V Dec 06 '14 at 23:15
-
I am down to learn. My problem is I learn a little here and learn a little there. In the end I have a little knowledge with everything lol. As they say jack of trades, Master at none! Thank you telling me about ATL up till this point I had never heard of it. – TheStart101 Dec 06 '14 at 23:42
-