Re: How to pass the events and values from ocx to html or JSP
Quote:
Originally Posted by zxmn50
I spent lot of time trying to learn c++ mfc, discovered lot of things.
Sure you have a lot of them not discovered yet. ;)
Quote:
One last question, how do i convert this activex using from shared DLLs to use Static libraries. I don't want this activex to have dependency on client machine.
Well, right now I just went to ActiveX project properties and set 'Use of MFC' to 'Use MFC in a Static Library'. Rebuilding after that I've got the OCX free of MFC-dll dependency. It seems still working good, though now it weighs 300K.
And I'd like to say the MFC ActiveX seems to be bad choice for the control which is distributed via web. You ought to take a look at ATL-based controls - they look much more slim. But you must be aware of that: the ATL is absolutely different beast. Of course it would be better to tame them both - MFC and ATL. :D
Re: How to pass the events and values from ocx to html or JSP
Igor,
I meant not to run as using shared dlls from windows on client machine when shipped with browser. I am not using any other control in my ActiveX, it's a simple control for tray icon balloon.
I am Ok with size, but i am trying for less dependency on client machine.
Thanks,
John
Re: How to pass the events and values from ocx to html or JSP
Thaks Igor,
You posted last message before me. I got size of 2.55 MB for .ocx file.
how do you know the size before packaging? Is there any quick packaging tool for cab in Vc 2005, like for VB?
-John
Re: How to pass the events and values from ocx to html or JSP
Quote:
Originally Posted by zxmn50
I got size of 2.55 MB for .ocx file.
Pretty much, huh? Against 300K of mine. It must be a lot of true color pictures in it to reach such a huge size. ;)
Quote:
how do you know the size before packaging?
Do you really think I do? No, no... I build first, then I know. :)
Quote:
Is there any quick packaging tool for cab in Vc 2005, like for VB?
I use old good CAB SDK and know nothing about whether VB can do OCX packaging or can not.
Re: How to pass the events and values from ocx to html or JSP
No, no. I don't have pictures or colors.
I also did static and rebuild your version test3.zip, still AxMfcTest2.ocx is 2616 KB. I am just wondering what file size you were telling for 300kb?
John
Re: How to pass the events and values from ocx to html or JSP
I believe you've built debug version, 'cause my debug build of OCX has 1.8M. But release (that one which must be shipped to customer) has 299,008 bytes. Since I've built this with VC7.1 but not VC8 the size of files of yours might be slightly bigger.
Another note:
In case your OCX is intended to be used not in web pages apparently there must be some installation application. This latter would register OCX in customer's system and install all modules the OCX is depending on. So you concerns about reduction of dependencies might be excessive a bit.
But finally it's all up to you.
PS. By the way your balloon would fail on W2k, I think so, because you didn't set version as required. I'm not give you 100% - but you'd have to check it for sure.
Re: How to pass the events and values from ocx to html or JSP
You are right. I used debug version of ocx file. I don't know how to get release verion to distribute.
We have complete java application, we needed this control to alert user, witouht disturbing him(he can continue working on other browsers or applications).
My intension is to load this ocx in client machine on our site login, and remove on logout.
I didn't test this on w2k? what would i need to run this on w2k? Do i need to pack dependents(?) even if i pack with static library links?
Thanks,
John
Re: How to pass the events and values from ocx to html or JSP
Hi Igor,
i got few more Q's, if you don't mind,
Is it possible to do ATL?
What is release ocx file than debug ocx, i took from debug folder, its too big!
How do i know what are dependents on ocx( i am using static Libs)?
How do i package including depndents into a cab file? (i made cab with cabarc using just debug ocx and inf file)
Is there any way i package(cab file) including dependents using installshield?
Thank you,
John
Re: How to pass the events and values from ocx to html or JSP
Quote:
Originally Posted by zxmn50
Is it possible to do ATL?
Sure it is. This possibility is highly stipulated by your skills - C++ in general and ATL in particular. :)
Quote:
What is release ocx file than debug ocx, i took from debug folder, its too big!
The release version of some binary module is the module free of additional information needed for debugging purposes. You have to select Release configuration on the Build toolbar - it would result in creation of Release subfolder in your project folder. There you can find release version of your OCX on build get finished.
Quote:
How do i know what are dependents on ocx( i am using static Libs)?
You can use the MS utility called Depends. Search your VC installation folder or MS site for it.
Quote:
How do i package including depndents into a cab file? (i made cab with cabarc using just debug ocx and inf file)
Search MS site for INF description - I believe [Add.Code] section is the right place where you specify all modules to be installed in client system on CAB import.
Quote:
Is there any way i package(cab file) including dependents using installshield?
See above.
Re: How to pass the events and values from ocx to html or JSP
Hi Igor,
As you know, I have MFC ActiveX control with MFC static library, i am using .ocx file from release folder to cab.
It works in my machine, but it's not working on different machines, means its not auto registering. Am i doing anything wrong here? Please help...
My cab command is,
cabarc.exe N AxMfcTest2.cab AxMfcTest2.ocx AxMfcTest2.inf
My html has,
<OBJECT ID="AxMfcTest21" WIDTH=100 HEIGHT=51
CLASSID="CLSIDBA2A4AB-B5FC-46AE-8530-56A857C5DA2F"
CODEBASE="AxMfcTest2.cab#version=1,0,0,0">
<PARAM NAME="_Version" VALUE="65536">
<PARAM NAME="_ExtentX" VALUE="2646">
<PARAM NAME="_ExtentY" VALUE="1323">
<PARAM NAME="_StockProps" VALUE="0">
</OBJECT>
My .inf file looks like,
------------------------------------------------------------------------------------------
[version]
; version signature (same for both NT and Win95) do not remove
signature="$CHICAGO$"
AdvancedINF=2.0
[Add.Code]
AxMfcTest2.ocx=AxMfcTest2.ocx
; These are the necessary supporting DLLs for MFC 4.2 ActiveX Controls
mfc42.dll=mfc42.dll
msvcrt.dll=msvcrt.dll
olepro32.dll=olepro32.dll
[AxMfcTest2.ocx]
file-win32-x86=thiscab
clsid={DBA2A4AB-B5FC-46AE-8530-56A857C5DA2F}
FileVersion=1,0,0,0
RegisterServer=yes
; dependent DLLs
[msvcrt.dll]
FileVersion=4,20,0,6164
hook=mfc42installer
[mfc42.dll]
FileVersion=4,2,0,6256
hook=mfc42installer
[olepro32.dll]
FileVersion=4,2,0,6068
hook=mfc42installer
[mfc42installer]
file-win32-x86=VALUE=http://activex.microsoft.com/controls/vc/mfc42.cab
run=%EXTRACT_DIR%\mfc42.exe
---------------------------------------------------------------------
Re: How to pass the events and values from ocx to html or JSP
Quote:
My html has,
<OBJECT ID="AxMfcTest21" WIDTH=100 HEIGHT=51
CLASSID="CLSIDBA2A4AB-B5FC-46AE-8530-56A857C5DA2F"
CODEBASE="AxMfcTest2.cab#version=1,0,0,0">
<PARAM NAME="_Version" VALUE="65536">
<PARAM NAME="_ExtentX" VALUE="2646">
<PARAM NAME="_ExtentY" VALUE="1323">
<PARAM NAME="_StockProps" VALUE="0">
</OBJECT>
What's this? Apparently it should look like:
Code:
CLASSID="CLSID:DBA2A4AB-B5FC-46AE-8530-56A857C5DA2F"
Please, use CODE tagging for code snippets.
Well, except this little misunderstanding your code looks almost perfect. Are you sure the CAB file is placed next to your web page file? Since you specify no folder, it must be in the same folder.
BTW, if the site lives on Linux (or any other *NIX system) make sure about file name case matching absolutely. :)
Does OCX is copied to client sytem?
I cannot see those additional dlls are packed into CAB. All modules mentioned in INF must be present in CAB, and their versions must match absolutely.
Re: How to pass the events and values from ocx to html or JSP
Hi Igor,
CLASSID is correct, some how this forum has formatted and took out colons. But my html has correct CLASSID. I have both html and cab files on the same folder. <b>If I register activex control manually using regsvr32, its working fine.</b>, Its supposed to auto-register on browser load.
The only thing i am missing from your reply is additional dlls(mfc42.dll, msvcrt.dll, olepro32.dll), i didn't add them to cab.
I am using VS2005 standard edition, are these dll's of correct version? Also when i searched for theses dlls in my machine, i found multiple copies with different sizes, from which folder should i pick?
Coming to my first target, control shouldn’t have any dependency in client machine. By adding these dlls, am I breaking my first rule? or do I need to add anything more to cab?
Thank you,
John
Re: How to pass the events and values from ocx to html or JSP
Sorry, i should have tested before posting last message.
Anyway, it worked if i package all 3 dlls in cab. I took them from system32 folder. Do i need all these 3 dlls?
Now cab size became 850kb. Is there any way i can reduce the size? by still sticking to first rule "no dependency on client machine" with MFC.
p.s. this is simple activex control, with only trayicon and balloon features.
Thanks
Re: How to pass the events and values from ocx to html or JSP
I believe those dlls you've mentioned are present on any Windows since original Windows 2000 (to be precise, Windows NT4 of some latest servicepack already got them), so I doubt if you really need to place them to cab. Anyway, you may place any module you chose - the only thing must be taken into account is the correct file version specification.
To make sure your cab acts correctly you may clean up your own system from OCX and open the web page with your <object> - the OCX must get installed in your system.
To clean up your system you may unregister OCX manually and make sure no your class registration is present in %SystemRoot%\Downloaded Program Files folder.
Re: How to pass the events and values from ocx to html or JSP
hai ,
We already discussed about How to pass values from ocx to JSP?.Right Now i have issue in deploying the activex control (ocx) in Internet.Any browser block the Ocx for security purpose.Browser ask certificate to verify the code.If i reduce my security level in browser.It will work fine otherwise.It won't download.How to sign the ocx or How to make ocx as safety one?whether any free tool is available to sign the ocx.
Regards
R.Jaiganesh