Author |
Topic |
|
hammarberg
New Member
Sweden
3 Posts |
Posted - Oct 27 2011 : 08:49:51 AM
|
If I declare a function DLLEXPORT, Find Reference will not work within it ("Find Reference not available because the symbol is unrecognized.") ...
Does not work (this is the smallest sample that I could find)
DLLEXPORT(BOOL) pcDumpLKF(LPCTSTR fn) { tstringmap lkf; CIni ini(fn); ini.clear(); lan(lkf); kommun(lkf); socken(lkf); ini.Write(_T("lkf"), lkf); return ini.empty()? FALSE : TRUE; }
This works
BOOL pcDumpLKF(LPCTSTR fn) { tstringmap lkf; CIni ini(fn); ini.clear(); lan(lkf); kommun(lkf); socken(lkf); ini.Write(_T("lkf"), lkf); return ini.empty()? FALSE : TRUE; }
and this
extern "C" __declspec(dllexport) BOOL __cdecl pcDumpLKF(LPCTSTR fn) { tstringmap lkf; CIni ini(fn); ini.clear(); lan(lkf); kommun(lkf); socken(lkf); ini.Write(_T("lkf"), lkf); return ini.empty()? FALSE : TRUE; }
For what I can see it all boils down to the macro DLLEXPORT() (which expanded should provide the last sample).
God hunt /Jonas
System info VA_X.dll file version 10.6.1859.0 built 2011.10.02 Licensed to: VA X: [email protected] (1-user license) Support ends 2012.02.25 DevEnv.exe version 10.0.30319.1 Ultimate msenv.dll version 10.0.30319.1 Comctl32.dll version 6.10.7600.16385 Windows 7 6.1 Build 7600 8 processors (x86-64; WOW64)
Platform: Project defined Stable Includes: d:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\include; d:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\atlmfc\\include; C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\include;
Other Includes:
Stable Source Directories: d:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\atlmfc\\src\\mfc; d:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\atlmfc\\src\\mfcm; d:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\atlmfc\\src\\atl; d:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\crt\\src;
|
|
accord
Whole Tomato Software
United Kingdom
3287 Posts |
Posted - Oct 27 2011 : 2:30:47 PM
|
Where does DLLEXPORT come from? What is the definition of the macro?
If you put the following line
#define DLLEXPORT into VA's pre-parsed file as described after the jump, it may help: http://docs.wholetomato.com?W302 |
|
|
hammarberg
New Member
Sweden
3 Posts |
Posted - Oct 28 2011 : 03:09:11 AM
|
It's one of my own macros to ease declaration of functions in a DLL used by a VB6-application.
#define DLLEXPORT(TYPE_OF_RESULT) extern "C" __declspec(dllexport) TYPE_OF_RESULT __cdecl
I've tried it but it didn't worked. I also tried to declare the macro just above as in the sample below, which didn't work either. I _think_ that it worked in 1856 but can't swear on that, for now I'll just expand the macro - it's not that often that new functions are added.
rgds /Jonas
#define DLLEXPORT2(TYPE_OF_RESULT) extern "C" __declspec(dllexport) TYPE_OF_RESULT __cdecl DLLEXPORT2(BOOL) pcDumpLKF(LPCTSTR fn) { tstringmap lkf; CIni ini(fn); ini.clear(); lan(lkf); kommun(lkf); socken(lkf); ini.Write(_T("lkf"), lkf); return ini.empty()? FALSE : TRUE; }
|
|
|
accord
Whole Tomato Software
United Kingdom
3287 Posts |
Posted - Oct 28 2011 : 6:53:12 PM
|
I am seeing the same effect with your snippet. To fix this, put the following line to the mentioned file:
#define DLLEXPORT2(x)
It didn't work without the parameter for me either but now it's working. This is only a workaround, indeed. The problem itself is that _declspec(dllexport) followed by BOOL or LRESULT is not parsed properly and is a known problem:
case=43514
Anyway, I'm seeing the same effect here with 1856 so it isn't a regression I think. |
|
|
hammarberg
New Member
Sweden
3 Posts |
Posted - Oct 31 2011 : 03:30:00 AM
|
Oki, thanks |
|
|
|
Topic |
|