Index  |  Reception  |  Libraries  |  DLL's Documentation
La LCO fue actualizada por última vez el 30/oct./2025

Integrating services using DLL

The DLL libraries developed by Solución Factible® are ActiveXControl COM elements, they can be used by any language that supports DLL import, such as: Visual Basic 6 (VB6), Microsoft Visual C++ (MSVC), Clarion, Visual Fox Pro, .NET languages such as C#, VB .NET, ASP, etc.

Installation

Depending on the programming language being used, this is the way in which a DLL will be imported into the project to be used. Sometimes the DLL has to be registered in the operating system, or you can use the .dll file directly, by calling it in its path.

One of the most common ways to install DLLs is to run the command: regsvr32 to register the DLL in the system:

C:\Users\SF\> regsvr32 SF_ActiveXCtrlCFDI_1.2.2.dll

Soluci�n Factible� also provides an installer, extracts and runs the command to register the dll in the system, in case you need the .dll file just go to "C:\SFDLL\" and you will find it here.

Steps:

  • 1.- Install the dll by running "SF DLL Installer.exe"
  • 2.- Wait for the registration confirmation message, then click "OK" and then continue.

Implementation in Visual Studio 2010

After running the dll installer or registering it manually with the regsvr32 command, the following steps are:

  • 1.- Go to project menu and select "Add reference".
  • 2.- Select the COM tab and search for the dll library with the prefix: "SF" and the name, such as: "Timbrar", for example to add the stamping dll we would search for: SFTimbrar.
  • 3.- Select and click "OK".

The reference is now part of your project, and can be seen in your solution explorer under "References", with a name like: SF_ConectorWS_TypeLib (the name varies depending on the DLL that has been imported) this name is the one we are going to use to instantiate the object and use the methods.

C#

                //Instantiating using Framework 3.5
                SF_ConectorWS_TypeLib.TimbrarClass timbrado35 = new SF_ConectorWS_TypeLib.TimbrarClass();

                //Instantiating using Framework 4.0
                SF_ConectorWS_TypeLib.Timbrar timbrado40 = new SF_ConectorWS_TypeLib.Timbrar();

                //Stamping:
                string responseXML = timbrado.timbrarCFDI("testing@solucionfactible.com", "timbrado.SF.16672", @"C:\F2011-06-09.xml", 0);
                
                //End of the program
        

Visual Basic .NET
                'Visual Basic 2008 Example

                Dim timbrado As New SF_ConectorWS_TypeLib.Timbrar
                Dim xmlResponse As String
                xmlResponse = timbrado.cancelar(
                    "testing@solucionfactible.com",
                    "timbrado.SF.16672",
                    "C:\iap031014rj2.cer",
                    "C:\iap031014rj2_17s.key",
                    "12345678a",
                    "26D51262-F8A6-40C4-9181-D9965BD37F25", 0)

                    'End of the program
        

Visual Basic 6
        'TIMBRAR TEST
        Dim timbrado
        'The string "SF.timbrar" is the ProgID (or name of the class as it was registered) 
        'of the stamping DLL, each DLL has a different one that can be consulted in its API
        Set timbrado = CreateObject("SF.timbrar")
        Text1.Text = timbrado.timbrarCFDI("testing@solucionfactible.com", "timbrado.SF.16672", "C:/F_A00001099.xml", 0)

        'End of the program
            
Delphi 7

Steps to import the dll

program TimbrarSF;
{$APPTYPE CONSOLE}

uses
  SysUtils,
  SF_ConectorWS_TypeLib_TLB,
  ActiveX;

var
  timbrar: TTimbrar;    //class we registered and name we gave it when importing the DLL
  usuario, password, cfdiPath, wsResponse: WideString;
  produccion: Integer;

begin
     CoInitialize(nil);
     timbrar := TTimbrar.Create(nil);
     usuario := 'testing@solucionfactible.com';
     password := 'timbrado.SF.16672';
     cfdiPath := 'C:\test.xml';
     produccion := 0;
     Writeln('Enviando a timbrar ' + cfdiPath);
     wsResponse := timbrar.timbrarCFDI(usuario, password, cfdiPath, produccion);
     Writeln('Response: ');
     Writeln(wsResponse);
     Readln(usuario); {Wait for an enter}
end.
            

PowerBuilder/Powershell
            OLEObject axTimbrado; 
            axTimbrado = CREATE OLEObject 
            #The string "SF.timbrar" is the ProgID (or name of the class as it was registered) 
            #of the stamping DLL, each DLL has a different one that can be consulted in its API            
			 integer result 
            result = axTimbrado.ConnectToNewObject("SF.timbrar"); 
            IF result = 0 THEN 
              MessageBox("SUCCESS Conexion con DLL", result, & Exclamation!, OK!, 2) 
              string respuesta 
              respuesta = axTimbrado.timbrarCFDI("testing@solucionfactible.com", "timbrado.SF.16672", "C:\SFDLL\xml.xml", 0) MessageBox("RESPUESTA DLL", respuesta, & Exclamation!, OK!, 2) 
            ELSE 
              MessageBox("FALLO Conexion con DLL", result, & Exclamation!, OK!, 2) 
            END IF
    
Datos de contacto
comments powered by Disqus