Jump to content
  • Advertisement
Sign in to follow this  
programci_84

[C++] Hiding and Debug

This topic is 2656 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all,

I'm writing my own DLLs for various purposes.

Example:

// zeTimer.h

#ifndef _TIMER_H_
#define _TIMER_H_

#include "blah.h"

#define ZE_INTERFACE(zeIFace) interface DECLSPEC_NOVTABLE zeIFace : public IUnknown
#define ZE_STDMETHOD(type) virtual COM_DECLSPEC_NOTHROW type STDMETHODCALLTYPE
#define ZE_API(type) __declspec (dllexport) type

ZE_INTERFACE (ZETimer)
{
public:
//IUnknown
ZE_STDMETHOD(HRESULT) QueryInterface ( THIS_ REFIID, LPVOID* ) PURE;
ZE_STDMETHOD(ULONG) AddRef ( THIS ) PURE;
ZE_STDMETHOD(ULONG) Release ( THIS ) PURE;

//other public ZETimer methods.
ZE_API(HRESULT) Tick ();
ZE_API(ULONG) GetFPS() const;
//blah blah blah
};

#endif


I'm hiding class member objects so that user cannot see them. Like this (for ZETimer above):

//zeTimer.cpp

#include "zeTimer.h"

struct Timer_Impl : public ZETimer
{
public:
ULONG m_fps;
float m_frameTime;
__int64 perfFreq;
__int64 current, last;

//blah blah
}


I'm compiling these DLLs with Debug (e.g. ZETimer_d.dll) and Release (e.g. ZETimer.dll) configurations, seperately.

My problem is: If I use Debug runtimes, while debugging, I can see that Timer_Impl (hiding class) members. But if I use Release runtimes, I cannot see them; I can see only IUnknown members (QueryInterface, AddRef and Release).

How can I hide that Timer_Impl members in Debug runtimes (i.e. Debugging)?

Hope I could explain my problem.

Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
Forget it guys, I've solved it.

That's the trick: On your DLL project, go to Project -> (YourProject) Properties -> Linker -> Debugging. Set Generate Debug Info to No.

Share this post


Link to post
Share on other sites
... blegh!?


Why the hell do you want to remove the primary advantage of a debug build (debuggability) by basically turning off everything that separates it from a Release build, sans optimizations?

This makes no sense to me.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!