Click here to Skip to main content
15,899,937 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: ShowWindow Command Problems Pin
Beaon7-Oct-07 8:36
Beaon7-Oct-07 8:36 
AnswerRe: ShowWindow Command Problems [modified] Pin
Beaon8-Oct-07 3:31
Beaon8-Oct-07 3:31 
AnswerRe: ShowWindow Command Problems Pin
David Crow5-Oct-07 8:02
David Crow5-Oct-07 8:02 
GeneralRe: ShowWindow Command Problems Pin
Beaon5-Oct-07 8:20
Beaon5-Oct-07 8:20 
QuestionAnti-Grain question Pin
Richard Blythe5-Oct-07 4:29
Richard Blythe5-Oct-07 4:29 
AnswerRe: Anti-Grain question Pin
Maximilien5-Oct-07 5:35
Maximilien5-Oct-07 5:35 
QuestionProblems with CreateDesktop Pin
GauranG Shah5-Oct-07 4:17
GauranG Shah5-Oct-07 4:17 
QuestionVC8 and stingray DLL issue Pin
OmniX5-Oct-07 3:42
OmniX5-Oct-07 3:42 
Alright, this is not code oriented and so I'll make it brieft:

Sorry don't know how to add code in this forum yet (rather new)

A class like this:

#ifndef VXT_SIMPLE_BUTTON_SPEC<br />
#ifdef  VXT_UIUTILS_DLL<br />
#define VXT_SIMPLE_BUTTON_SPEC __declspec(dllexport)<br />
#else<br />
#define VXT_SIMPLE_BUTTON_SPEC __declspec(dllimport)<br />
#endif<br />
#endif<br />
<br />
class  VXT_SIMPLE_BUTTON_SPEC vxtUISimpleButton: public CGXStatic



the inherited class is FROM stingray and is now using dll interface compared to previous release like so:

#ifdef _GXDLL<br />
	#ifdef _GXDLL_IMPL<br />
		#define GRID_API __declspec( dllexport )<br />
//		#pragma message("GRID_API: dllexport")<br />
	#else<br />
		#define GRID_API __declspec( dllimport ) <br />
//		#pragma message("GRID_API: dllimport")<br />
	#endif<br />
#else //  !_GXDLL<br />
	#define GRID_API<br />
#endif<br />
<br />
<br />
class CGXStatic : public CGXControl<br />
{<br />
	DECLARE_CONTROL(CGXStatic)<br />
<br />
// Construction<br />
public:<br />
	// Constructor & Destructor<br />
	GRID_API CGXStatic(CGXGridCore* pGrid);<br />
<br />
	GRID_API virtual CRect GetCellRect(ROWCOL nRow, ROWCOL nCol, LPRECT rectItem = NULL, const CGXStyle* pStyle = NULL);<br />
		// compute the interior rectangle for the text<br />
		// without buttons and borders<br />
	GRID_API virtual CSize AddBorders(CSize size, const CGXStyle& style);  // counterpart to GetCellRect<br />
<br />
	GRID_API virtual CSize CalcSize(CDC* pDC, ROWCOL nRow, ROWCOL nCol, const CGXStyle& style, const CGXStyle* pStandardStyle, BOOL bVert);<br />
<br />
	GRID_API virtual BOOL CanFloatCell(ROWCOL nRow, ROWCOL nCol, const CGXStyle& style, BOOL bFloatOrFlood);<br />
<br />
	GRID_API virtual void Draw(CDC* pDC, CRect rect, ROWCOL nRow, ROWCOL nCol, const CGXStyle& style, const CGXStyle* pStandardStyle);<br />
<br />
	// cells tips enable<br />
	GRID_API void ImplementCellTips();<br />
};<br />


Now this returns:
error C2487: member of dll interface class may not be declared with dll interface
When using the macro:
#define DECLARE_CONTROL(class_name) \<br />
protected: \<br />
	GRID_API static CGXControlClass* PASCAL _GetControlBaseClass(); \<br />
public: \<br />
	static GX_DATA CGXControlClass ctrl##class_name; \<br />
	GRID_API virtual CGXControlClass* GetControlClass() const; \<br />
<br />
#define IMPLEMENT_CONTROL(class_name, base_class_name) \<br />
	CGXControlClass* PASCAL class_name::_GetControlBaseClass() \<br />
		{ return CONTROL_CLASS(base_class_name); } \<br />
	GX_DATADEF CGXControlClass class_name::ctrl##class_name = { \<br />
		#class_name, &class_name::_GetControlBaseClass }; \<br />
	CGXControlClass* class_name::GetControlClass() const \<br />
		{ return &class_name::ctrl##class_name; } \<br />
<br />
DECLARE_CONTROL(vxtUISimpleButton)



So I tried not using dllimport ON the class but instead on every functions

Which returned this:
warning C4273 : inconsistent dll linkage

on the macro:
<br />
#define IMPLEMENT_CONTROL(class_name, base_class_name) \<br />
	CGXControlClass* PASCAL class_name::_GetControlBaseClass() \<br />
		{ return CONTROL_CLASS(base_class_name); } \<br />
	GX_DATADEF CGXControlClass class_name::ctrl##class_name = { \<br />
		#class_name, &class_name::_GetControlBaseClass }; \<br />
	CGXControlClass* class_name::GetControlClass() const \<br />
		{ return &class_name::ctrl##class_name; } \<br />
<br />
IMPLEMENT_CONTROL(vxtUISimpleButton, CGXStatic)


Which is present because (I think) that we defined this function:

virtual VXT_SIMPLE_BUTTON_SPEC vxtVoid Draw(CDC* pDC, CRect rect, ROWCOL nRow, ROWCOL nCol, const CGXStyle& style, const CGXStyle* pStandardStyle);

and the stingray class defined it this way:

GRID_API virtual void Draw(CDC* pDC, CRect rect, ROWCOL nRow, ROWCOL nCol, const CGXStyle& style, const CGXStyle* pStandardStyle);

Both are on dllImport

Any suggestion on how to "cleanly" remove the error and warning?
QuestionSomething about CxImage class Pin
Jane1315-Oct-07 2:52
Jane1315-Oct-07 2:52 
QuestionRe: Something about CxImage class Pin
Hamid_RT5-Oct-07 3:01
Hamid_RT5-Oct-07 3:01 
AnswerRe: Something about CxImage class Pin
Jane1316-Oct-07 1:39
Jane1316-Oct-07 1:39 
GeneralRe: Something about CxImage class Pin
Hamid_RT6-Oct-07 19:24
Hamid_RT6-Oct-07 19:24 
GeneralRe: Something about CxImage class Pin
Jane13119-Oct-07 16:05
Jane13119-Oct-07 16:05 
GeneralRe: Something about CxImage class Pin
Hamid_RT21-Oct-07 19:38
Hamid_RT21-Oct-07 19:38 
GeneralRe: Something about CxImage class Pin
Jane13125-Oct-07 3:35
Jane13125-Oct-07 3:35 
GeneralRe: Something about CxImage class Pin
Hamid_RT25-Oct-07 4:42
Hamid_RT25-Oct-07 4:42 
GeneralRe: Something about CxImage class Pin
Jane13125-Oct-07 15:35
Jane13125-Oct-07 15:35 
GeneralRe: Something about CxImage class Pin
Hamid_RT25-Oct-07 20:48
Hamid_RT25-Oct-07 20:48 
QuestionRe: Something about CxImage class Pin
Hamid_RT28-Oct-07 21:23
Hamid_RT28-Oct-07 21:23 
GeneralRe: Something about CxImage class Pin
quiettimes8-Jan-08 23:46
quiettimes8-Jan-08 23:46 
QuestionCRegKey::QueryValue (...) fails [modified] Pin
Nelek5-Oct-07 2:47
protectorNelek5-Oct-07 2:47 
AnswerRe: CRegKey::QueryValue (...) fails Pin
David Crow5-Oct-07 3:34
David Crow5-Oct-07 3:34 
GeneralRe: CRegKey::QueryValue (...) fails Pin
Nelek8-Oct-07 3:45
protectorNelek8-Oct-07 3:45 
AnswerRe: CRegKey::QueryValue (...) fails Pin
Rahul Vaishnav5-Oct-07 4:18
Rahul Vaishnav5-Oct-07 4:18 
GeneralRe: CRegKey::QueryValue (...) fails Pin
David Crow5-Oct-07 5:42
David Crow5-Oct-07 5:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.