Fetstil Fetstil Kursiv Understrykning linje färgläggning tabellverk Punktlista Nummerlista Vänster Centrerat högerställt Utfyllt Länk Bild htmlmode
  • Forum & Blog
    • Forum - översikt
      • .Net
        • asp.net generellt
        • c#
        • vb.net
        • f#
        • silverlight
        • microsoft surface
        • visual studio .net
      • databaser
        • sql-server
        • databaser
        • access
        • mysql
      • mjukvara klient
        • datorer och komponenter
        • nätverk, lan/wan
        • operativsystem
        • programvaror
        • säkerhet, inställningar
        • windows server
        • allmänt
        • crystal reports
        • exchange/outlook
        • microsoft office
      • mjukvara server
        • active directory
        • biztalk
        • exchange
        • linux
        • sharepoint
        • webbservers
        • sql server
      • appar (win/mobil)
      • programspråk
        • c++
        • delphi
        • java
        • quick basic
        • visual basic
      • scripting
        • asp 3.0
        • flash actionscript
        • html css
        • javascript
        • php
        • regular expresssion
        • xml
      • spel och grafik
        • DirectX
        • Spel och grafik
      • ledning
        • Arkitektur
        • Systemutveckling
        • krav och test
        • projektledning
        • ledningsfrågor
      • vb-sektioner
        • activeX
        • windows api
        • elektronik
        • internet
        • komponenter
        • nätverk
        • operativsystem
      • övriga forum
        • arbete karriär
        • erbjuda uppdrag och tjänster
        • juridiska frågor
        • köp och sälj
        • matematik och fysik
        • intern information
        • skrivklåda
        • webb-operatörer
    • Posta inlägg i forumet
    • Chatta med andra
  • Konto
    • Medlemssida
    • Byta lösenord
    • Bli bonsumedlem
    • iMail
  • Material
    • Tips & tricks
    • Artiklar
    • Programarkiv
  • JOBB
  • Student
    • Studentlicenser
  • KONTAKT
    • Om pellesoft
    • Grundare
    • Kontakta oss
    • Annonsering
    • Partners
    • Felanmälan
  • Logga in

Hem / Forum översikt / inlägg

Posta nytt inlägg


msxml parser

Postades av 2003-01-16 01:10:29 - Björn Svensson, i forum activeX, Tråden har 1 Kommentarer och lästs av 1166 personer

Någon som vet hur man kan se vilken version av msxml2.dll (2.x eller 3) som används när man försöker parsa xml ?
/Björne


Svara

Sv: msxml parser

Postades av 2003-01-17 00:20:17 - Pelle Johansson

Har den inte installerad så jag kan inte testa koden, men kolla först om det finns egenskap som heter .Version?, alternativt app.verson, app.major och app.minor.

En annan variant är ett utdrag som jag fann på nätet. Jag översätter den inte men hoppas att du i alla fall kan läsa den och förstå. Om det löser sig, lägg då gärna upp koden i tips & tricks.

Hälsningar
/pelle

------------------------------------

If you go via CLSID, then you must ensure the CLSID is going to be found.

If you open up regedit & browse down to the CLSID for one of the classes in your DLL, you'll find a sub key called InProcServer32 which contains the path to your DLL on that machine. ( It also has a Version number which is the version number of that particular 'class'. )

But how do we get the CLSID ? ( without hard coding it in, and which will require changing anytime you change the classes interface at all, i.e. add a new public property or function, or even just recompile with Project compatibility ) We can use a method somewhat similar to how the OS late binds ...

First, you know what the ProgID will be, this is unlikely to change. EG. MyDLL.MyFirstClass

Next, you pass it to a function somewhat like this

<code>
Private Function msRetrieveCLSID(ByVal vsComponentNm As String) As String
''------------------------------------------------------------------------------
'' Name : msRetrieveCLSID
'' Description : Retrieve the CLSID of the ActiveXServer.Class passed
'' in via vsComponentNm from the registry
'' Date : 28/08/2001
'' PreCondition : Len(vsComponentNm) > 0
'' PostCondition : n/a
'' Input Parameters : vsComponentNm - The component name to look for
'' Output Parameters : n/a
'' Return Value : String - The CLSID of the component we are wanting to document
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim loReg As clsRegistry

On Error GoTo error_handler

msRetrieveCLSID = ""
Set loReg = New clsRegistry

loReg.ClassKey = HKEY_CLASSES_ROOT
loReg.SectionKey = Trim$(vsComponentNm) & "\Clsid"
If loReg.KeyExists Then
loReg.ValueType = REG_SZ
msRetrieveCLSID = loReg.Value
End If

Exit Function

error_handler:

Set loReg = Nothing
Err.Raise Err.Number, "mdlInterface.msRetrieveCLSID" & vbCrLf & Err.Source, Err.Description

End Function
</code>

It's a simple front end for a set of API's used to browse the registry. If you haven't got one already yourself, there's plenty of good code to do the same thing out on the 'net.

Basically, all this does is gets us the CLSID for our ProgID. Next, we want to get the path to the DLL itself, based on the CLSID ( now, remember, that each class in your DLL is going to have a CLSID registered, but they are all going to ( hopefully !! ) point to the same DLL on the system.

To get the path to the DLL use soimething similar to this

<code>
Private Function msRetrievePath(ByVal vsCLSID As String) As String
''------------------------------------------------------------------------------
'' Name : msRetrievePath
'' Description : Retrieve the path of the ActiveXServer ( DLL )
'' from the registry
'' Date : 28/08/2001
'' PreCondition : Len(vsCLSID) > 0
'' PostCondition : n/a
'' Input Parameters : vsCLSID - The CLSID of the Class
'' Output Parameters : n/a
'' Return Value : String - The path for where the registered DLL resides on the
'' local filesystem.
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim loReg As clsRegistry
Dim sKeyNames() As String
Dim llKeyCount As Long
Dim llCount As Long

On Error GoTo error_handler

msRetrievePath = ""
Set loReg = New clsRegistry

loReg.ClassKey = HKEY_CLASSES_ROOT
loReg.SectionKey = "CLSID\" & Trim$(vsCLSID) & "\InprocServer32\"
If loReg.KeyExists Then
loReg.ValueType = REG_SZ
msRetrievePath = loReg.Value
End If

Exit Function

error_handler:

Set loReg = Nothing
Err.Raise Err.Number, "mdlInterface.msRetrievePath" & vbCrLf & Err.Source, Err.Description

End Function
</code>

Cool. Now we have the path to the DLL. So, what next ?

Well, either use the code at the link provided by naga1979, or might I suggest also investigating the functionality provided to you by the TypeLib Information DLL ( TlbInf32.dll ) ? Lovely little library this. A guide to using it can be found in its help file which can be downloaded at

http://msdn.microsoft.com/downloads/default.asp?url=/downloads/sample.asp?url=/MSDN-FILES/027/000/255/msdncompositedoc.xml

Anyway, this is all dependant also on which versionnumber you are actually after .... there are two version numbers typically for a DLL, there's the numbers you'll get from using App.MAjor, App.Minor ( which will not increment with each build if you turn off the auto increment button ) or theres the 'internal' version number of the DLL which WILL autoincrement with each build if there have been any changes to any of the classes within the DLL ( oh, and don't forget either that each class will also have its own version number )

To give you an idea, the dump below is a section of a dump file I produce to track changes made to our products DLL's with each build

The DLL in question has an App.Major of 2, an App.Minor of 3

The numbers on the end are the INTERNAL version numbers of the DLL & two of its classes

<code>
DLL,T1S1EPG22.DLL,,{3D2CB102-4E6D-11D5-84E1-00104B1CF34E},,2.1
COCLASS,,CLSS1EPGACADEMICTRANS,{3D2CB104-4E6D-11D5-84E1-00104B1CF34E},{FAB8DEC2-63B4-11D5-84EA-00104B1CF34E},1.0
COCLASS,,CLSS1EPGAUTOGRADUATE,{3D2CB106-4E6D-11D5-84E1-00104B1CF34E},{94BF2EF4-A003-11D5-B5B1-00010307F15C},1.1
COCLASS,,CLSS1EPGPROCESSREQ,{3D2CB108-4E6D-11D5-84E1-00104B1CF34E},{FAB8DEC4-63B4-11D5-84EA-00104B1CF34E},1.0
</code>

So, which version number are you after ??


Svara

Nyligen

  • 09:09 Vill du köpa medicinska tester?
  • 12:47 Vem beviljar assistansen – kommune
  • 14:17 Någon med erfarenhet av hemstädnin
  • 14:14 Bör man använda sig av en båtförme
  • 14:12 Finns det någon intressant hundblo
  • 14:25 Tips på verktyg för att skapa QR-k
  • 14:23 Tips på verktyg för att skapa QR-k
  • 20:52 Fungerer innskuddsbonuser egentlig

Sidor

  • Hem
  • Bli bonusmedlem
  • Läs artiklar
  • Chatta med andra
  • Sök och erbjud jobb
  • Kontakta oss
  • Studentlicenser
  • Skriv en artikel

Statistik

Antal besökare:
Antal medlemmar:
Antal inlägg:
Online:
På chatten:
4 569 153
27 952
271 704
687
0

Kontakta oss

Frågor runt konsultation, rådgivning, uppdrag, rekrytering, annonsering och övriga ärenden. Ring: 0730-88 22 24 | pelle@pellesoft.se

© 1986-2013 PelleSoft AB. Last Build 4.1.7169.18070 (2019-08-18 10:02:21) 4.0.30319.42000
  • Om
  • Kontakta
  • Regler
  • Cookies