Jump to content
Software FX Community

How to detect programmatically whether SfxBar.dll is registered?


User (Legacy)

Recommended Posts

Hi,

What registry keys to check or what is the recommended

way to detect whether the SfxBar.dll and Cfx4032.dll

is registered?

I am adding to our application the automatic registration

of the SfxBar.dll and of the Cfx4032.dll. The registration

should be done only when the components are

not registered, yet. Then, the file is searched on the

expected place and if all condition hold, the registration

is done via the following function (C++):

bool RegisterDll(std::string DllName)

{

replace(DllName.begin(), DllName.end(), '/', '\\');

HMODULE hLib = LoadLibrary(DllName.c_str());

if (hLib == 0)

return false;

FARPROC lpDllEntryPoint = GetProcAddress(hLib,

TEXT("DllRegisterServer"));

HRESULT hr = E_FAIL;

if (lpDllEntryPoint != 0)

hr = (*lpDllEntryPoint)();

if (hLib != 0)

FreeLibrary(hLib);

return SUCCEEDED(hr);

}

This is already successfully done with other dll's like Visual FoxPro

Runtime.

Whether it is installed or not is determined so, that we try to get

handle to registry key that is constructed from the ProgID

"VisualFoxpro.Runtime.6".

Are there a ProgIDs that can be reliably used to detect whether SfxBar.dll

and Cfx4030.dll are installed? For example, can "SfxBar.CommandBar"

be used for the purpose?

Thanks,

Petr

--

Petr Prikryl (prikrylp at skil dot cz)

Link to comment
Share on other sites

Hi,

This is related to my previous question.

> What registry keys to check or what is the recommended

> way to detect whether the SfxBar.dll and Cfx4032.dll

> is registered?

I tried to use "SfxBar.CommandBar" and "ChartFXCom.Chart"

to detect the status. Then I tried to register programmatically

the Cfx4032.dll. I have observed the message box that said

that SfxBar.dll was not found at the path and listed something

that looks like content of the PATH environment variable.

I tried also to register SfxBar.dll earlier, but the behaviour

was the same.

Does it mean that I should change the working directory

to the subdirectory where the dll's are placed? Why?

(When I did, it worked fine.)

Thanks,

Petr

--

Petr Prikryl (prikrylp at skil dot cz)

Link to comment
Share on other sites

1) SfxBar.dll needs to be in the SAME folder as cfx4032.dll (cfx4032.ocx)

2) When either SFXBAR or Chart FX register, there is many entries written in

the registry, you can check for either one. For example, you can check for

the ProgID's:

ChartFXCom.Chart: cfx4032.dll

ChartFX.Chart: cfx4032.ocx

SfxBar.ToolBar: sfxbar.dll

--

FP

Software FX

Link to comment
Share on other sites

Hi,

"SoftwareFX Support" wrote...

> 1) SfxBar.dll needs to be in the SAME folder as cfx4032.dll (cfx4032.ocx)

Yes, it always was. But also, it seems that when Cfx4032.dll is

registered, the SfxBar.dll is not searched in the same directory

but in the working directory and then in directories named

in the PATH environment variable.

In other words, when I did register Cfx4032.dll via regsvr32.exe

(placed in a batch file) the working directory was identical with

the placement of the dll's. However, when registering the dll's

programmatically, the working directory was different and full

path to the dll's was used. Both dll's were in the same directory.

Still, the being registered Cfx4032.dll complained that SfxBar.dll

was not found.

I have solved the problem by temporarily changing the working

directory to the dll's one (and back after registration). Then

everything worked as expected. Probably, if the dll's were

placed in directory listed in PATH, it would also be fine

(I did not try that).

> 2) When either SFXBAR or Chart FX register, there is many

> entries written in...

Thanks for confirming that I am not doing something

completely silly ;)

Regards,

Petr Prikryl

--

Petr Prikryl (prikrylp at skil dot cz)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...