ColdFusion 8 and DOTNET (Visual Studio 2008)

I am trying to use a class library compiled to a dll in a cold fusion page.  I can access some of the public functions, but others come back with a not found error.

Also,  how do I use an enumeration from the class library in cold fusion and in general  are there any tutorials/blogs/urls that offer guidance into how to interface Cold Fusion with DOT NET DLLs?  
Howard BashSenior Software EngineerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Howard BashSenior Software EngineerAuthor Commented:
All these examples are very basic (no pun intended).  None of them address how to use class properties and their accessability.  Can I use enumerations from my class library/dll?  Can I returned my own class objects?

I think you can only use types which can be marshalled between the coldfusion and .NET. Does ColdFusion support enums?
10 Tips to Protect Your Business from Ransomware

Did you know that ransomware is the most widespread, destructive malware in the world today? It accounts for 39% of all security breaches, with ransomware gangsters projected to make $11.5B in profits from online extortion by 2019.

Howard BashSenior Software EngineerAuthor Commented:
"Does ColdFusion support enums?"  ... Does Coldfusion support .NET Enums.
Also, does it support properties,  shared classes,  etc. ?
Howard BashSenior Software EngineerAuthor Commented:
Here is my latest result.  It seems (by experiment) that if I pass an integer to my DOTNET DLL function, which expects an enumeration value (also an integer of value 1) it fails.  However,  if I instead have a function that takes an integer as a parameter instead of the enum, coldfusion works.

It's a bit surprising that it has this problem, as under the hood the enum values are of type integer.
But the type of the parameter has to match even though its int under the hood. Can you not use integer instead? I know enum is more readable but if ColdFusion is unable to use it then you have no option.
Howard BashSenior Software EngineerAuthor Commented:
Sure I can use integers.   It's unfortunate though in several ways.  First, although the enumerations are all of type integer and yet CF kicks out for them.  Secondly,  the intellisense that I give up when I replace the enums as just integers is a loss for development and readability.

For example if I have an enum as follows:
Public Enum DataConnectionStrings
End Enum

Then a function definition:
Public Function GetConnectionString(whichConnection as DataConnectionString) as string
   select case whichConnection
     case ProductionString
        return "Prod Info"
     case DevelopmentString
        return "Dev Info"
   end select
End Function

As you see this self documents nicely.  
Howard BashSenior Software EngineerAuthor Commented:
Also,  it appears that CF cannot "see" public properties.  I really need a list of the various interactions allowable between CF and .NET.

Public Functions - yes
Public Properties - no

And an example of what is possible would be great as well.
(no points ...)

I really need a list of the various interactions allowable between CF and .NET.

Silly question but have you checked the documentation on .net integration? It's not extensive, but does touch on some of the questions you've mentioned liked enums and properties.  IIRC

* implicit _conversion_ of enums are not supported
* public properties are supported using get_propertyName() / set_propertyName()  AND
* public functions should be supported

Howard BashSenior Software EngineerAuthor Commented:
There is a good amount of information in the URL you specified above.  However,  is there a way to have cold fusion unload the dll?  While developing the dll,  I can stop and start the cold fusion .net service and that works.  But this is only good for development.
Unfortunately not that I know of.  Java jars work the same way.  AFAIK once the dll/jar is loaded into memory, a stop/start is the only way to unload it / or load a newer version.  
.. It's a bit of a pain. But unloading/reloading isn't something I normally need to do in a prod environment, only development.
Howard BashSenior Software EngineerAuthor Commented:
How about stopping and starting the Cold Fusion 8 .NET Service programmatically from within CF?
Is that possible?
That's possible.  All you need is a .bat file that calls "net stop" or "net start".  

example bat file:
net stop "ColdFusion 9 .NET Service"

Then call the bat file with cfexecute:

<cfexecute name="c:\fullPathTo\yourBatFile.bat" .... />

The only possible hitch is permissions. The windows account CF is running under must have permission to use net start/stop.  
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ColdFusion Language

From novice to tech pro — start learning today.