Continue to Site

Welcome to MCAD Central

Join our MCAD Central community forums, the largest resource for MCAD (Mechanical Computer-Aided Design) professionals, including files, forums, jobs, articles, calendar, and more.

MFC DLL for Pro/E?

stomata

New member
Hi,
Is there anyway I can write a dll plugin for Pro/E with a MFC DLL project?
I tried to do it put it gives me linking error of these

MFCPlugin error LNK2001: unresolved external symbol __pctype
MFCPlugin error LNK2001: unresolved external symbol __pctype
MFCPlugin error LNK2001: unresolved external symbol __pctype
MFCPlugin error LNK2019: unresolved external symbol __pctype referenced in function _pfa_mem_debug
MFCPlugin error LNK2001: unresolved external symbol __pctype
MFCPlugin error LNK2001: unresolved external symbol __pctype
MFCPlugin error LNK2001: unresolved external symbol __pctype
MFCPlugin error LNK2019: unresolved external symbol __pctype referenced in function _pro_spawn_for_version_check
MFCPlugin error LNK2019: unresolved external symbol __pctype referenced in function _strtows
MFCPlugin error LNK2001: unresolved external symbol __pctype
MFCPlugin error LNK2001: unresolved external symbol __pctype
MFCPlugin error LNK2001: unresolved external symbol ___mb_cur_max
MFCPlugin error LNK2001: unresolved external symbol ___mb_cur_max
MFCPlugin error LNK2001: unresolved external symbol ___mb_cur_max
MFCPlugin error LNK2019: unresolved external symbol ___mb_cur_max referenced in function _pfa_mem_debug
MFCPlugin error LNK2019: unresolved external symbol ___mb_cur_max referenced in function _pfu_ftruncate
MFCPlugin error LNK2001: unresolved external symbol ___mb_cur_max
MFCPlugin error LNK2019: unresolved external symbol ___mb_cur_max referenced in function _ntlangwrap_GetVolumeInfo
MFCPlugin error LNK2019: unresolved external symbol ___mb_cur_max referenced in function _pro_spawn_for_version_check
MFCPlugin error LNK2001: unresolved external symbol ___mb_cur_max
MFCPlugin error LNK2001: unresolved external symbol ___mb_cur_max
MFCPlugin error LNK2001: unresolved external symbol ___mb_cur_max
MFCPlugin error LNK2019: unresolved external symbol _errno referenced in function _ptc_exit
MFCPlugin error LNK2001: unresolved external symbol _errno
MFCPlugin error LNK2019: unresolved external symbol _errno referenced in function _pfafs_make_parent
MFCPlugin fatal error LNK1120: 3 unresolved externals


, thanks
 
i use MFC in my dll:

put that at the top of the stdafx.h file (before the includes)

extern "C"
{
int __mb_cur_max;
int errno;
}

dont forget to put in your Project Options/linker/input/additional dependencies
"protk_dll.lib wsock32.lib mpr.lib psapi.lib"


put this in your Project Options/linker/input/Ignore specific libraries: "libc.lib"


And put your Project Options/C/C++/Code generation/Runtime library to Multi-threaded Debug (/MTd)



I may have forgotten something .. give me feedback please =)
Edited by: David_Hyper
 
Thanks
and now I have these errors pop up~

c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\ctype.h(158): error C2370: '__mb_cur_max' : redefinition; different storage class
c:\Program Files\proeWildfire 3.0\protoolkit\includes\ProWchar.h(34): error C2632: 'short' followed by 'wchar_t' is illegal

and if I use /Mtd, it gives me this error
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxver_.h(139): fatal error C1189: #error : Please use the /MD switch for _AFXDLL builds




Edited by: stomata
 
#define _WCHAR_T
#define PRO_USE_VAR_ARGS


before the includes in stdafx.h

the redefinition of the __mb_cur_max is pretty weird ..


try commenting it then:


extern "C"
{
//int __mb_cur_max;
int errno;
}


for the MTd switch .. my project uses MFC as a static linked library
Project Options/General/Use of MFC/Use MFC in a Static Library
Edited by: David_Hyper
 
David_Hyper said:
#define _WCHAR_T
#define PRO_USE_VAR_ARGS


before the includes in stdafx.h

the redefinition of the __mb_cur_max is pretty weird ..


try commenting it then:


extern "C"
{
//int __mb_cur_max;
int errno;
}

If I comment out the __mb_cur_max, I get this
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\ctype.h(158): error C2370: '__mb_cur_max' : redefinition; different storage class

do you think it's related to the /Mtd build?
 
"for the MTd switch .. my project uses MFC as a static linked library
Project Options/General/Use of MFC/Use MFC in a Static Library"


set it to MTd


use MFC as a static library

comment the __mb_cur_max


and rebuild all the solution

GL man =)
 
Thanks~
But it gives me this error.........
>.<

c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\cstringt.h(644): error C3861: '_vscwprintf': identifier not found, even with argument-dependent lookup
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\cstringt.h(649): error C3861: 'vswprintf': identifier not found, even with argument-dependent lookup
 
mmm .. im using VS 2005 and i can see you are using VS 2003, i did not have this error ..

But i think its because you should use the Unicode Character Set


Project options/General/Character Set/Use Unicode Character Set


and be sure that the UNICODE and _UNICODE defines are present
 
David_Hyper said:
mmm .. im using VS 2005 and i can see you are using VS 2003, i did not have this error ..

But i think its because you should use the Unicode Character Set


Project options/General/Character Set/Use Unicode Character Set


and be sure that the UNICODE and _UNICODE defines are present

hmmm I changed it to use Unicode set, but the error still comes up.....
 
Add this in your


Project Options/C/C++/Preprocessor/Preprocessor definitions: _UNICODE



im searching on the net for this kind of problem .. and it really seems to be a unicode stuff
Edited by: David_Hyper
 
David_Hyper said:
Add this in your


Project Options/C/C++/Preprocessor/Preprocessor definitions: _UNICODE



im searching on the net for this kind of problem .. and it really seems to be a unicode stuff

I have it already.....
I use the same kind of setting in C dll for Pro/e and it works....
But it gives me those errors in MFC....
smiley18.gif

But I appreciate your help~
thank you~
 
David_Hyper said:
im sure we are very close to our goal .. if i can make it work with VS 2005 .. im sure we can with 2003

End up it's my project problem
I used a messed up MFC project .... that's y
I restart a new project and did whatever you said and it works fine now!!!
Thanks!!!!!!!!!!!!!!
smiley32.gif
 

Sponsor

Articles From 3DCAD World

Back
Top