Copy link to clipboard
Copied
Hi:
I have Visual C++ 2008 express edition to compile my custom cfx tag. Here are my steps:
1. new project -> Win32 -> Win32 Project, enter project name
2. Application Type: DLL, Finish
3. Project -> properties -> C/C++ -> General -> Additional Include Directories includes "C:\ColdFusion8\cfx\include"
4. #include "cfx.h"
4. Finish my code
My problem is my code surely has the "void ProcessTagRequest(CCFXRequest* pRequest)" function, but after I register my cfx, my cfm keeps giving me an error message: "Native CFX library does not have a ProcessTagRequest entry point."
I am guessing it's not a problem in my code, since I could compile my code no any error. I am guessing it's my visual c++ project setting problem, causing coldfusion unable to see my function. Any one has any clue?
Thanks.
Copy link to clipboard
Copied
I figured out the problem mysql.
I have to add "extern "C" __declspec( dllexport )" before my ProcessTagRequest function, but I also tried only "__declspec( dllexport )", which doesn't work.
Can anyone explain why I really need the extern "C" to work? The visual c++ documentation states that compiler does not require "extern "C" " to export function. Why do I need that for coldfusion?
Thanks.
Copy link to clipboard
Copied
many years later...
the "extern "C" " ensures, your entry points name is really "ProcessTagRequest", because some compiler add letters or other characters to it.
PS: You can use dumpbin.exe /EXPORTS your.dll to check the names.