Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do I integrate compiled .NET code with QuickMacros?
#7
I haven't even been able to test this. Here's my dilema:

This is part of the code of my class:

Code:
Copy      Help
namespace NamespaceX
{

    public enum DatabaseType
    {
        SQLServer = 1,
        DB2 = 2
    }

    public struct JobParameter
    {
        public string parameterName, parameterValue;
    }

    public interface IDbJobHandler
    {
        void Configure (string appDbServer, string appDbName,
            bool appDbWindowsAuthentication, string appDbUserName, string appDbPassword);

        bool RunJob (string jobId, JobParameter[] parameters, bool autoCommits,
            string server, string dbName, string dataSource,
            bool windowsAuthentication, string userName, string password,
            ref long mainCommandAffectedRows);
    }

    public class DbJobHandler: IDbJobHandler
    {
        
        private string appDbServer, appDbName, appDbUserName, appDbPassword;
        private bool appDbWindowsAuthentication;
        
        public DbJobHandler ()
        {
        }

        
        public void Configure (string appDbServer, string appDbName,
            bool appDbWindowsAuthentication, string appDbUserName, string appDbPassword)
        {
            this.appDbServer = appDbServer;
            this.appDbName = appDbName;
            this.appDbWindowsAuthentication = appDbWindowsAuthentication;
            this.appDbUserName = appDbUserName;
            this.appDbPassword = appDbPassword;
        }


        public bool RunJob (string jobId, JobParameter[] parameters, bool autoCommits,
            string server, string dbName, string dataSource,
            bool windowsAuthentication, string userName, string password,
            ref long mainCommandAffectedRows)
        {
            :
            :
            some code
            :
            :
        }
    }

}

And here's my QM code so far:

Code:
Copy      Help
typelib library "D:\Development\SyncS6MIS\SyncS6MISData\bin\Release\SyncS6MISData.tlb"

;----------------------------------------------------------------------------------
; DbJobHandler database configuration
;----------------------------------------------------------------------------------
str DJH_SERVER, DJH_DBNAME, DJH_USERNAME, DJH_PASSWORD
int DJH_WINAUTH

DJH_SERVER = "xxxxx"
DJH_DBNAME = "xxxxx"
DJH_WINAUTH = -1  ;;False
DJH_USERNAME = "xxxxx"
DJH_PASSWORD = "xxxxx"

;----------------------------------------------------------------------------------
; S6MIS database configuration
;----------------------------------------------------------------------------------
str S6M_SERVER, S6M_DBNAME, S6M_DATASOURCE, S6M_USERNAME, S6M_PASSWORD
int S6M_WINAUTH

S6M_SERVER = "xxxxx"
S6M_DBNAME = "xxxxx"
S6M_DATASOURCE = "xxxxx"
S6M_WINAUTH = -1  ;;False
S6M_USERNAME = "xxxxx"
S6M_PASSWORD = "xxxxx"

;----------------------------------------------------------------------------------
; Miscellaneous configuration
;----------------------------------------------------------------------------------
int AUTOCOMMITS

AUTOCOMMITS = 1  ;;True

library.IDbJobHandler jobHandler._create(uuidof(library.DbJobHandler))
jobHandler.Configure(DJH_SERVER, DJH_DBNAME, DJH_WINAUTH, DJH_USERNAME, DJH_PASSWORD)

library.IJobParameter parameter
ARRAY(library.IJobParameter) parameterSet
int successful
long affectedRows

jobHandler.Configure(DJH_SERVER, DJH_DBNAME, DJH_WINAUTH, DJH_USERNAME, DJH_PASSWORD)

;----------------------------------------------------------------------------------
; Job: CP_CAT (Create & Populate Catalog tables
;----------------------------------------------------------------------------------
parameterSet.create(0)
successful = jobHandler.RunJob("CP_CAT", parameterSet, AUTOCOMMITS, S6M_SERVER, S6M_DBNAME, S6M_DATASOURCE, S6M_WINAUTH, S6M_USERNAME, S6M_PASSWORD, affectedRows)

out "I'm done!"

When I run it, I get a type mismatch error in the parameterSet parameter. I've also tried declaring parameter and parameterSet the following way instead and get the same type mismatch error:

Code:
Copy      Help
type PARAMETER str name, str value
PARAMETER parameter
ARRAY(PARAMETER) parameterSet

Any ideas?

Also, feel free to correct anything in my code or suggest other ways to do things. This is my first time coding in QM and my knowledge is only limited to the few examples I have seen on here, the application help and, most of all, your feedback.

Thanks once again!


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)