Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Translation from VB to VFP
Message
From
01/11/2005 17:34:17
 
 
To
01/11/2005 14:12:53
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
01062354
Message ID:
01064263
Views:
17
OK, FWIW, the ASP dll they sent me works (once they reminded me of COMARRAY() when passing arrays to com objects).

Thanks for the article link and your help.

>Well that is not entirely accurate. I think you said you had vfp 7 or better, so try declaring your variables as the type that this library is expecting, and try your code.
>
>If this is all they told you, (without specifics) then they're just BS'ing you so as to not provide support.
>
>Check out this oldie but goodie article on vfp 7 to get some details on this:
>
>http://msdn.microsoft.com/msdnmag/issues/01/10/VFP7/default.aspx
>
>>It turns out it is some problem with the way the dll was written and the way VFP handles variables. Here's whatthe company have said:
>>
>>"- FoxPro seems to type all variables as "Variant" rather than using strict
>>variable typing (like Integer, Float, String, Object, etc.)
>>
>>- As a result of this, FoxPro doesn't communicate properly with COM objects
>>that use Microsoft's standard type conventions for passing data back and
>>forth"
>>
>>They have a dll used for ASP and that seems to be getting me closer.
>>
>>Thanks.
>>
>>>You got it. Now if the second call did not work perhaps it is due to the Database class being a member of the Netrics class. Maybe there is a method or property of the Netrics class where you can obtain an instance of the Database object, something like:
>>>
>>>myNetricsDb = myNetricsObject.GetDb("Test")
>>>
>>>or
>>>
>>>myNetricsDb = myNetricsObject.DatabaseObject
>>>
>>>Check the docs if you have them, or test about with the intellisense in the command window.
>>>
>>>>Thanks,
>>>>
>>>>let me just confirm that I am following your instructions properly:
>>>>
>>>>1. Opened Object Browser
>>>>2. Opened the type library for the com object
>>>>3. Clicked on the name of the library in the tree view in the browser
>>>>4. Copied the guid from the information display at the bottom of th eobject browser
>>>>5. Ran regedt32 and did a find for the guid.
>>>>6. This displayed a typelib and 2 entries above that a progid.
>>>>7. Copied the data from the progid ("Netrics.Netrics.1") to the command window and did a ox = createobject("Netrics.Netrics.1").
>>>>8. This worked, to an extent.
>>>>9. I also did oxDB = CREATEOBJECT("netrics.database.1")
>>>>10. Then oxDB.Name = "Test"
>>>>11. then I get the error OLE error code 0x8002801d: Library not registered.
>>>>
>>>>Did I do the right thing?
>>>>
>>>>>OK, click on the NetricsLib branch in the o.browser and notice the guid and file name (dll) at the bottom. Find this in the registry looking for a key called "ProgID" associated with the entry.
>>>>>
>>>>>If it's there look at the data for it, you should be able to CreateObject this. If it's not there then maybe the library cannot be used this way.
>>>>>
>>>>>>Thanks, I forgot about the Object Browser (I'm using VFP9). Now if I can only make sense of what I am seeing. I found the Netrics stuff and opened it. It displays as NETRICSLib and it has a class called Netrics.
>>>>>>
>>>>>>I tried ox = createobject("Netricslib.netrics") and get the error about the class definition not being found.
>>>>>>
>>>>>>It seems the vendors are able to duplicate my problems (but not consistently) so it is apparently some problem with the library, but wish I could make more sense of it.
>>>>>>
>>>>>>>It sounds like you have VFP7 or newer, why don't you check the Tools->Object browser->COM libraries?
>>>>>>>
>>>>>>>If you can find it you should be able to identify the callable classes.
>>>>>>>
>>>>>>>>Hey Borislav,
>>>>>>>>
>>>>>>>>I'm still having some problems! :(
>>>>>>>>
>>>>>>>>If I do
>>>>>>>>
>>>>>>>>loNetrics = createobject("netrics.netrics")
>>>>>>>>
>>>>>>>>I can then get the intellisense working when I type loNetrics. in the command window, but I get an error when trying to execute the command:
>>>>>>>>
>>>>>>>>OLE error code 0x8002801d: Library not registered.
>>>>>>>>
>>>>>>>>Stranger still, if I create a PRG and declare this:
>>>>>>>>
>>>>>>>>LOCAL loNetrics as
>>>>>>>>
>>>>>>>>I get intellisense showing NetricsLib in the list!
>>>>>>>>
>>>>>>>>Now I'm completely confused.
>>>>>>>>
>>>>>>>>Thanks for any help you (or anyone else) can offer.
>>>>>>>>
>>>>>>>>
>>>>>>>>>>Found the Netrics keys in the registry (using Regedt32, not regsvr32 :)).
>>>>>>>>>>
>>>>>>>>>>What do you mean by "check the whole key"? Do you mean the CLSID? What do I do with it?
>>>>>>>>>>
>>>>>>>>>>Just in case this makes any difference, the com objects are supposed tobe in a DLL, which is what was registered on the PC.
>>>>>>>>>>
>>>>>>>>>>Thanks.
>>>>>>>>>>
>>>>>>>>>>>OK,
>>>>>>>>>>>Open registry with regsvr32. Open HKEY_CLASSES_ROOT and search for SearchOpts. If you found it check whole key.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>No, not CLSID. I mean the Text in the Node of the treeview that is above CLSID node :-)
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Previous
Reply
Map
View

Click here to load this message in the networking platform