Not sure if this is the right board, but here it goes.
I'm trying to learn how to create a COM object in a C++ DLL, register it properly, and then use it in a .aspx page.
My [desired] usage is this: (custom math class and add function used for simplicity to learn):
Code:
<%@ Page Language="VB" Debug="true" aspcompat="true" %>
<script language="vb" runat="server">
Sub Page_Load(sender as Object, e as EventArgs)
Dim oMath=Server.CreateObject("MathX.CCalculator.1")
Dim c=0
oMath.Add(1,2,c) 'c should be 1+2=3
Response.Write(c)
Response.End()
End Sub
</script>
Then I created and registered the DLL, but when I run the aspx page I get this error:
"System.NullReferenceException: Object reference not set to an instance of an object."
It is referring to the oMath object being null. So, now I'm not sure what I need to add to my DLL to make this work... I have the 4 COM functions created and then exported like such in the DEF file:
Code:
EXPORTS
DllCanUnloadNow PRIVATE
DllGetClassObject PRIVATE
DllRegisterServer PRIVATE
DllUnregisterServer PRIVATE
And I have an ICalculator interface, a CCalculator object class, and a CFCalculator class factory implemented.
Can someone point me in the right direction? Or where to look? I'm not even sure where the problem would be. I can give specific code of the C++ DLL if necessary.