Plugin development with VC8

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: Hacker, petermad, Stefan2, white

Post Reply
djorge
Senior Member
Senior Member
Posts: 422
Joined: 2003-07-03, 12:48 UTC
Location: Portugal

Plugin development with VC8

Post by *djorge »

Have anyone already tried VC8 to develop a (FS) plugin (without managed code)?
I am having some problems with function exports?

I have added a def file with the required functions for totalcmd (FSInit,...),
but my output dll doesn't have any exported functions.
______________________
David Jorge
Personal License #117854
User avatar
Flint
Power Member
Power Member
Posts: 3501
Joined: 2003-10-27, 09:25 UTC
Location: Belgrade, Serbia
Contact:

Post by *Flint »

djorge
I've just tried to recompile my FS-plugin VirtualDisk in VS8 (the plugin is developed in VS6) - and all worked well, exported functions are visible, the plugin is working.
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 11.03 / Win10 x64
djorge
Senior Member
Senior Member
Posts: 422
Joined: 2003-07-03, 12:48 UTC
Location: Portugal

Post by *djorge »

I have recompiled a fs plugin made in VC6 either and it worked fine, but when i try to start a new dll project with VC8, the exported functions are not exported.
______________________
David Jorge
Personal License #117854
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50421
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I don't have VC8, but if it's similiar to VC6, did you add the .def file to your source list in the project? Otherwise it will be ignored.
Author of Total Commander
https://www.ghisler.com
User avatar
majkinetor !
Power Member
Power Member
Posts: 1580
Joined: 2006-01-18, 07:56 UTC
Contact:

Post by *majkinetor ! »

I don't know what is going on at my place but I have similar problems with VC 7:

This is the source template I created but it doesn't work despite the fact that functions are exported:

Code: Select all

#include "stdafx.h"
#define DllExport   __declspec( dllexport )

const int _FieldsNum = 1;

BOOL APIENTRY DllMain( HANDLE hModule, DWORD  ul_reason_for_call,  LPVOID lpReserved	 )
{
 
	return TRUE;
}

DllExport int __stdcall ContentGetSupportedField(int FieldIndex,char* FieldName,char* Units,int maxlen)
{	
	if ( (FieldIndex < 0) || (FieldIndex >= _FieldsNum) )
		return ft_nomorefields;

    strncpy(FieldName, "test field", maxlen);
    return ft_string;
}

DllExport int __stdcall ContentGetValue(char* FileName,int FieldIndex,int UnitIndex,void* FieldValue,int maxlen,int flags)
{
	if ( (FieldIndex < 0) || (FieldIndex >= _FieldsNum) )
		return ft_nosuchfield;

    if ( (flags && CONTENT_DELAYIFSLOW) > 0 )
		return ft_delayed;

 
  strncpy((char*)FieldValue, "test value", maxlen);
  return ft_string;
}
All compiler options are default.
The FileInfo plugin lists this:

Code: Select all

 int __stdcall ContentGetSupportedField(int, char *, char *, int)
 int __stdcall ContentGetValue(char *, int, int , void *, int, int)
Does anybody know what is going on ?
The same code works in Delphi 2005 !.
Habemus majkam!
djorge
Senior Member
Senior Member
Posts: 422
Joined: 2003-07-03, 12:48 UTC
Location: Portugal

Post by *djorge »

2ghisler(Author)
Yes. I've added the def file as i usulally do with VC6 and i also have added the compiler option to use this file in the "Module Definition File".

But VC8 keeps complaining:
Linking...
TCStartMenu.def : error LNK2001: unresolved external symbol FsFindClose
TCStartMenu.def : error LNK2001: unresolved external symbol FsFindFirst
TCStartMenu.def : error LNK2001: unresolved external symbol FsFindNext
TCStartMenu.def : error LNK2001: unresolved external symbol FsInit
D:\Programming\tc\WFX\TC FS StartMenu\Release\TCStartMenu.lib : fatal error LNK1120: 4 unresolved externals
______________________
David Jorge
Personal License #117854
User avatar
majkinetor !
Power Member
Power Member
Posts: 1580
Joined: 2006-01-18, 07:56 UTC
Contact:

Post by *majkinetor ! »

Hej , are you working on windows start menu plugin ?
Nice idea if so....
Habemus majkam!
djorge
Senior Member
Senior Member
Posts: 422
Joined: 2003-07-03, 12:48 UTC
Location: Portugal

Post by *djorge »

Well, the idea is to build a fs to modify the TC start menu like Ultra TC Main Menu Editor does. Ultra TC Main Menu Editor is a great tool but i think it will be great if i could do the same via an FS plugin. The main problem is that menu entries can't be sorted. But then i could sort the menu with Ultra TC main editor.

But the main purpose is to study the FS TC interface and make my first official plugin because now i have some time available for my own projects. But the code can be easilly modified to the windows start menu although i think it wouldn't be so usefull.
______________________
David Jorge
Personal License #117854
User avatar
majkinetor !
Power Member
Power Member
Posts: 1580
Joined: 2006-01-18, 07:56 UTC
Contact:

Post by *majkinetor ! »

I don't know what is going on at my place but I have similar problems with VC 7:
Solved.
Bad : #define DllExport __declspec( dllexport )
Good: #define DllExport export "C" __declspec( dllexport )
Habemus majkam!
djorge
Senior Member
Senior Member
Posts: 422
Joined: 2003-07-03, 12:48 UTC
Location: Portugal

Post by *djorge »

I've just tried to recompile my FS-plugin VirtualDisk in VS8 (the plugin is developed in VS6) - and all worked well, exported functions are visible, the plugin is working.
What about dll dependency?
My dll has the folowing dependencies:
MFC80.dll
MSVCR80.dll
MSVCP80.dll
Did your project ported from VC6 become dependent of all VC8 dll?
______________________
David Jorge
Personal License #117854
User avatar
Flint
Power Member
Power Member
Posts: 3501
Joined: 2003-10-27, 09:25 UTC
Location: Belgrade, Serbia
Contact:

Post by *Flint »

djorge
Of course it becomes (my plugin needs MFC80.DLL and MSCVR80.DLL). It's because the project is compiled with newer CRT and MFC versions, which need newer DLL files.
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 11.03 / Win10 x64
Post Reply