code_junkie

How to make consistent dll binaries across VS versions?

Nov 11th, 2011
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. struct IExportedMethods {
  2. virtual long __stdcall AMethod(void)=0;
  3. };
  4. // with the win32 macros:
  5. interface IExportedMethods {
  6. STDMETHOD_(long,AMethod)(THIS)PURE;
  7. };
  8.  
  9. class CMyObject: public IExportedMethods { ...
  10.  
  11. extern "C" __declspec(dllexport) IExportedClass* WINAPI CreateMyExportedObject(){
  12. return new CMyObject;
  13. }
  14.  
  15. interface IExportedMethods {
  16. STDMETHOD_(void) Release(THIS) PURE; };
  17. class CMyObject : public IExportedMethods {
  18. STDMETHODIMP_(void) Release(){
  19. delete this;
  20. }
  21. };
  22.  
  23. #pragma pack(push,4)
  24. typedef myStruct {
  25. int a;
  26. char b;
  27. float c;
  28. }myStruct;
  29. #pragma pack(pop)
Add Comment
Please, Sign In to add comment