The module variable in the COM DLL made by VB.net cannot be initialized

zhu guan 1 Reputation point
2022-03-03T08:42:48.327+00:00

I made a component with vb6, the component has a module variable.
Another vc6 project will call the vb6 component through the CreateDispatch method.
When I upgraded the vb6 component to vb.net, the module variable of the component is no longer initialized when it is called.

VC6 → VB6
First: gbCreatePosUriage=False
Second: gbCreatePosUriage=False

179548-vb6.png

VC6 → VB.NET
First: gbCreatePosUriage=False
Second: gbCreatePosUriage=True

179450-vbnet.png

How can vb.net initialize variables like vb6?

demo → 1678800

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
36,455 questions
{count} votes