Wrappers de VXml para Microsoft Visual Basic .NET VXml
Estos wrappers (definiciones de funciones en una DLL) son necesarios para utilizar VXml en sus programas basados en Microsoft VisualBasic .NET.

VB .NET, al igual que C# y Delphi RadStudio, utilizan las funciones en formato WIDE, por lo que los nombres de las funciones de VXml son distintos, pero simplemente hay que agregar una letra W al final de los nombres de cada función y la funcionalidad y paramétros son los mismos

Copie el contenido mostrado a continuación en su proyecto VB.NET para poder usarlo en su programa.

Definir un nuevo Wrapper es muy sencillo,  el wrapper de VB.NET  se basa en una estructura con 2 componentes por funcion:

Prototipo:
         <DllImport(<nombre del DLL>, CharSet = CharSet.Unicode, EntryPoint := "<función VXmlW>")>		
 El prototipo de la funcion define la ubicacion de la DLL en <nombre del DLL>, el juego de caracteres que se utilizan, que siempre sera de tipo Unicode y el "EntryPoint" que es el nombre de la función dentro de la DLL, en este caso, por ser funciones tipo WIDE, su nombre termina con una letra W mayúscula <función VXmlW>.

Definición de la función

         Public Shared <funcion o subrutina> <nombre funcion> ( <param1> As <tipo>, <param2> As <tipo>,..., <paramN> As <tipo> ) As <valor devuelto>
La definción de la funcion comienza con las palabras reservadas Public Shared. seguido por el indicativo Function, si la función devuelve un valor, o Sub si la función no devuelve nada, esto se indica en <funcion o subrutina>, si la función devuelve un valor numérico entonces tendra el valor de IntPtr, si el valor de retorno es una cadena de caracteres tendrá el valor de String, que se indica en <valor devuelto>

A continuación deberemos expresar el nombre con el que deseamos llamar a la función dentro de nuestro programa en <nombre funcion>, que puede ser el mismo que el nombre del EntryPoint o puede ser distinto.

Luego debemos listar los Parámetros de la función indicando su tipo (IntPtr o String) después de la palabra reservada As.

Finalmente, si la función develve algun valor, deberemos expresar su tipo (IntPtr o String) después de la palabra reservada As, si la función no devuelve ningun valor, no se especifica ningun valor.

Esta estructura deberá repetirse para cada función que se desee utilizar.

Fecha de actualización : 08 de Julio de 2024 se añadieron las funciones para Carta Porte 3.1
Wrapper:

<DllImport("VXML_x86.dll", CharSet:=CharSet.Unicode, EntryPoint:="VXML_NewW")> _
Public Shared Function VXML_New ( szVersion As String ) As IntPtr
End Function

<DllImport("VXML_x86.dll", CharSet:=CharSet.Unicode, EntryPoint:="VXML_FreeW")> _ Public Shared Sub VXML_Free ( p As IntPtr ) End Sub

<DllImport("VXML_x86.dll", CharSet:=CharSet.Unicode, EntryPoint:="VXML_NewWithLogW")> _ Public Shared Function VXML_NewWithLog ( szVersion As String, cNombreLog As String ) As IntPtr End Function

<DllImport("VXML_x86.dll", CharSet:=CharSet.Unicode, EntryPoint:="VXML_SetLogFileW")> _ Public Shared Sub VXML_SetLogFile ( p As IntPtr, NombreLog As String ) End Sub

<DllImport("VXML_x86.dll", CharSet:=CharSet.Unicode, EntryPoint:="VXML_SetUserInfoW")> _ Public Shared Sub VXML_SetUserInfo ( hXml As IntPtr, szUser As String, servidor As String ) End Sub

<DllImport("VXML_x86.dll", CharSet:=CharSet.Unicode, EntryPoint:="VXML_ProcesaDocumentoW")> _ Public Shared Function VXML_ProcesaDocumento ( hXml As IntPtr, csd As String, key As String, keypwd As String, outfile As String ) As IntPtr End Function

<DllImport("VXML_x86.dll", CharSet:=CharSet.Unicode, EntryPoint:="VXML_ProcesaDocumentoSSLW")> _ Public Shared Function VXML_ProcesaDocumentoSSL ( hXml As IntPtr, csd As String, key As String, keypwd As String, outfile As String ) As IntPtr End Function

<DllImport("VXML_x86.dll", CharSet:=CharSet.Unicode, EntryPoint:="VXML_AddCfdiRelacionados_cfdi40W")> _ Public Shared Sub VXML_AddCfdiRelacionados_cfdi40 ( p As IntPtr, TipoRelacion As String, UUID1 As String, UUID2 As String, UUID3 As String, UUID4 As String, UUID5 As String, UUID6 As String, UUID7 As String, UUID8 As String, UUID9 As String, UUID10 As String ) End Sub

<DllImport("VXML_x86.dll", CharSet:=CharSet.Unicode, EntryPoint:="VXML_AddCfdiRelacionado_cfdi40W")> _ Public Shared Sub VXML_AddCfdiRelacionado_cfdi40 ( p As IntPtr, UUID As String ) End Sub

<DllImport("VXML_x86.dll", CharSet:=CharSet.Unicode, EntryPoint:="VXML_SetComprobanteInfo_cfdi40W")> _ Public Shared Sub VXML_SetComprobanteInfo_cfdi40 ( p As IntPtr, Serie As String, Folio As String, Fecha As String, FormaDePago As String, CondicionesDePago As String, SubTotal As String, Descuento As String, Moneda As String, TipoCambio As String, Total As String, TipoDeComprobante As String, MetodoDePago As String, LugarExpedicion As String, Confirmacion As String, Exportacion As String ) End Sub

<DllImport("VXML_x86.dll", CharSet:=CharSet.Unicode, EntryPoint:="VXML_SetEmisorInfo_cfdi40W")> _ Public Shared Sub VXML_SetEmisorInfo_cfdi40 ( p As IntPtr, RFC As String, Nombre As String, RegimenFiscal As String, FacAtrAdquirente As String ) End Sub

<DllImport("VXML_x86.dll", CharSet:=CharSet.Unicode, EntryPoint:="VXML_SetReceptorInfo_cfdi40W")> _ Public Shared Sub VXML_SetReceptorInfo_cfdi40 ( p As IntPtr, RFC As String, Nombre As String, ResidenciaFiscal As String, NumRegIdTrib As String, UsoCFDI As String, DomicilioFiscalReceptor As String, RegimenFiscalReceptor As String ) End Sub

<DllImport("VXML_x86.dll", CharSet:=CharSet.Unicode, EntryPoint:="VXML_AddConcepto_cfdi40W")> _ Public Shared Sub VXML_AddConcepto_cfdi40 ( p As IntPtr, ClaveProdServ As String, NoIdentificacion As String, Cantidad As String, ClaveUnidad As String, Unidad As String, Descripcion As String, ValorUnitario As String, Importe As String, Descuento As String, ObjetoImp As String ) End Sub

<DllImport("VXML_x86.dll", CharSet:=CharSet.Unicode, EntryPoint:="VXML_AddConceptoTraslado_cfdi40W")> _ Public Shared Sub VXML_AddConceptoTraslado_cfdi40 ( p As IntPtr, Base As String, Impuesto As String, Tipofactor As String, TasaOCuota As String, Importe As String ) End Sub

<DllImport("VXML_x86.dll", CharSet:=CharSet.Unicode, EntryPoint:="VXML_SetImpuestosInfo_cfdi40W")> _ Public Shared Sub VXML_SetImpuestosInfo_cfdi40 ( p As IntPtr, totalImpuestosTrasladados As String, totalImpuestosRetenidos As String ) End Sub

<DllImport("VXML_x86.dll", CharSet:=CharSet.Unicode, EntryPoint:="VXML_AddTraslado_cfdi40W")> _ Public Shared Sub VXML_AddTraslado_cfdi40 ( p As IntPtr, Impuesto As String, TipoFactor As String, TasaOCuota As String, Importe As String, Base As String ) End Sub

<DllImport("VXML_x86.dll", CharSet:=CharSet.Unicode, EntryPoint:="VXML_GetValueW")> _ Public Shared Function VXML_GetValue ( hXml As IntPtr, value As IntPtr ) As String End Function