locked
console app error - No such interface supported RRS feed

  • Question

  • I have a VS 2010 C++ application that is developed as a console app.  When I build the application and run it on my developmetn PC, the application runs as expected.  When I take the EXE and put it on the server to be ran, I get an error code = 80004002, code meaning = No such interface supported

    I have .Net frame work 4.0 on the server, I installed the C++ 2010 redistributable files.  Still get the same error.

    Any ideas where to look next? 

    When I build a debug version and run it, it jsut gives an R6010 abort() has been called message.

    Friday, May 24, 2013 6:48 PM

Answers

All replies

  • Hi,

    Welcome here. Maybe the problem is in your project.

    Would you mind provide some code snippets or upload your project to SkyDrive and give us the link of it for further support?

    It is not necessary that you send out the whole of your project. We just need a simplest sample to reproduce the problem. You can remove any confidential information or business details from it.

    Have a nice day.

    Regards,


    Elegentin Xie
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, May 27, 2013 6:58 AM
  • I will get a copy of the application loaded tomorrow.  It is strange that it works great on my development PC, but only gives the error when running on another machine.  Are there other files that VS 2010 C++ needs to run executable that may not be included in the exe?

    Tuesday, May 28, 2013 4:06 AM
  • After more debugging it appears to get the error when it tries to connect to my database.  Here is the code that is being ran.   It seems to fail on Connection 1.   I am able to connect to the database from this server.  THe login and password are correct, have tried different ones.   I can run this application on my PC without issue.  I am trying to deploy it to the server so it can be scheduled. 

    Unfortunately I am not a C++ developer and the person that developed this application in 2002 has long gone.  We just discovered an issue once we got to a certain limit on a code and needed to make 1 quick change to this and now I can't get it to work on the server again. 

    #include "StdAfx.h" #include "ar_intf.h" #include "AR Interface.h" extern CWinApp theApp; extern FILE *genex = NULL, *logfile = NULL; /********************************************************************* * *FUNCTION: AR_intf item interface * *DESCRIPTION: Main engine for creating the open item interface files * from the Agency billing systems to AXS-One AR Software. * *PARAMETERS: Server Name, database name, login, password * char(30) Server Name * char(30) Database Name * char(30) login

    * char(30) password

    * *CALLED BY: _tmain * *FUNCTIONS REFERENCED: * get_companies() * get_next_batch_number() * get_batch_hdr() * get_invoice_hdr() * get_invoice_detl() * *RETURN VALUES: * return 0 if successful else errno. * *FUNCTION LOGIC: * *Connect to database (Need three connections to database *to process the two invoice headers and detail lines together and get *the batch number) *Logon to database *Open a report log file *Set global variables *Get list of companies that had invoices *For each company do the following: * *create_batch_hdr() * *For each invoice header that has not been posted to *AR & has been printed * select a invoice header line from the database * write header line to file * call invoice_detl function * * } *End of for each invoice header item loop *End of for each company loop *End of function description ********************************************************************/ int ar_intf (TCHAR server[30], TCHAR database[30], TCHAR login[30], TCHAR password[30]) { CString file; TCHAR companies[20][4]; int i; int batch_number, return_code, numc; time_t value; _ConnectionPtr pConnect1 = NULL, pConnect2 = NULL, pConnect3 = NULL; _CommandPtr pCommand1 = NULL, pCommand2 = NULL, pCommand3 = NULL; _bstr_t strCnn, strCnn1; HRESULT hr; /** Open a log file **/ file = server; file += "_"; file += database; file += ".log"; logfile = fopen((LPCTSTR) file, "w"); if (logfile == NULL) { printf ("Unable to open log file %s\n", (LPCTSTR) file); exit_cleanly(5, pConnect1, pConnect2, pConnect3); } value=time((time_t *) 0); fprintf(logfile, "Started processing at %s\n", ctime(&value) ); /******************** * Initialize database, i.e. establish udp connection * with database server ********************/ strCnn1 = "Provider=SQLOLEDB.1;"; if ( strcmp("SSPI", login) == 0 ) strCnn1 += "Trusted_Connection=Yes;"; else { strCnn1 += "Persist Security Info=True;User Id="; strCnn1 += login; strCnn1 += ";Password="; strCnn1 += password; strCnn1 += ";"; } strCnn1 += "Application Name=AR_Interface;Data Source="; strCnn = strCnn1 + server; strCnn += ";Initial Catalog="; strCnn += database; /************************** * Log onto MS SQL Server database server, as specified on the * command line. pConnect1 used for getting list of * companies to process, creating batch header and * selecting invoices to interface **************************/ // Connection 1 try { hr = TESTHR (pConnect1.CreateInstance(__uuidof(Connection))); pConnect1->Open (strCnn, "", "", adConnectUnspecified); TESTHR(pCommand1.CreateInstance (__uuidof(Command))); pCommand1->ActiveConnection = pConnect1; } catch (_com_error &e) { if (pConnect1) PrintProviderError (pConnect1); PrintComError (e); exit_cleanly (1, NULL, NULL, NULL); } // Connection 2, used for getting invoice details try { TESTHR (pConnect2.CreateInstance(__uuidof(Connection))); pConnect2->Open (strCnn, "", "", adConnectUnspecified); TESTHR(pCommand2.CreateInstance (__uuidof(Command))); pCommand2->ActiveConnection = pConnect2; pCommand2->CommandText = "sp_open_item_detail"; pCommand2->CommandType = adCmdStoredProc; pCommand2->Parameters->Refresh(); } catch (_com_error &e) { if (pConnect2) PrintProviderError (pConnect2); PrintComError (e); exit_cleanly (1, NULL, NULL, NULL); } // Connection 3, Connect to datawhse to get batch number try { TESTHR (pConnect3.CreateInstance(__uuidof(Connection))); pConnect3->Open (strCnn, "", "", adConnectUnspecified); TESTHR(pCommand3.CreateInstance (__uuidof(Command))); pCommand3->ActiveConnection = pConnect1; } catch (_com_error &e) { if (pConnect3) PrintProviderError (pConnect3); PrintComError (e); exit_cleanly (1, NULL, pConnect2, NULL); } #ifdef DEBUG printf("Successfully created 3 database connections\n"); #endif // Get list of companies that have invoices numc = get_companies(pCommand1, &companies[0]); if (numc == _FAILED) { fprintf (logfile, "No companies with invoices\n"); exit_cleanly(100, pConnect1, pConnect2, pConnect3); } /* Get the batch number from datawhse_db */ if ( (batch_number = get_batch_number(pConnect3)) == _FAILED) exit_cleanly (8, pConnect1, pConnect2, pConnect3); file = server; file += "_"; file += database; file += ".load"; genex = fopen((LPCTSTR) file, "w"); if (genex == NULL) { fprintf (logfile, "Could not open genex file %s\n", (LPCTSTR)file); exit_cleanly(9, pConnect1, pConnect2, pConnect3); } #ifdef DEBUG fprintf (stderr, "Opened load file\n"); #endif /***HERE*/ /** Set the GL Posting Date **/ if (set_gl_posting_date (pCommand1) != _SUCCESS) exit_cleanly (61, pConnect1, pConnect2, pConnect3); /* Now let's loop through each company and output its invoices */ for (i = 0; i <= numc ; i++) { /** Open a file for company download info **/ fclose (logfile); rmallws(companies[i]); file = companies[i]; file += ".log"; logfile = fopen((LPCTSTR) file, "w"); if (logfile == NULL) { printf ("Unable to open log file\n"); exit_cleanly(5, pConnect1, pConnect2, pConnect3); } #ifdef DEBUG fprintf (stderr, "Opened log file\n"); #endif fprintf(logfile, "Started processing at %s\n", ctime(&value) ); fprintf(logfile, "Outputting invoices for %s\n", companies[i]); fflush (logfile); /** Set the next batch number **/ batch_number++; /** Create and print out the batch header **/ #ifdef DEBUG fprintf (stderr, "Create batch header\n"); #endif return_code = create_batch_hdr(pCommand1, batch_number, companies[i]); if (return_code == _FAILED) exit_cleanly(8, pConnect1, pConnect2, pConnect3); else if (return_code == _NORESULTS) { batch_number--; continue; } fflush(genex); /** process each invoice_header **/ #ifdef DEBUG fprintf (stderr, "Write Invoice Header\n"); #endif return_code = write_invoice(pCommand1, pCommand2, batch_number, companies[i]); fflush(genex); if (return_code != _SUCCESS) exit_cleanly(return_code, pConnect1, pConnect2, pConnect3); /** Touch the ar_posting_date **/ #ifdef POST #ifdef DEBUG fprintf (stderr, "Set AR Posting Date\n"); #endif return_code = set_ar_posting_date (pCommand1, companies[i]); if ( return_code != _SUCCESS ) fprintf (logfile, "** Problem setting ar_posting_date for company %s\n", companies[i]); #endif } /** Update the batch_number **/ if (put_batch_number(pConnect3, batch_number) == _FAILED) fprintf (logfile, "Unable to save batch_number %i back to database", batch_number); return_code = _SUCCESS; exit_cleanly(return_code, pConnect1, pConnect2, pConnect3); return 0; } /*END ar_intf()*/ /*********************************************************************** *FUNCTION: exit_cleanly() *DESCRIPTION: This function is used to close all database connections, * then shut down the report generator. ***********************************************************************/ void exit_cleanly(long exit_value, _ConnectionPtr pConnect1, _ConnectionPtr pConnect2, _ConnectionPtr pConnect3) { time_t value; /* value=time((time_t *) 0);*/ value=time(NULL); pConnect1->Close(); pConnect2->Close(); pConnect3->Close(); _fcloseall(); //fclose(genex); //fclose(logfile); fflush(stdout); #ifdef DEBUG printf("Exiting with value %d, Time = %s\n", exit_value, ctime(&value)); #endif exit(exit_value); /** Will also close any open files here **/ } /********************************************************************** * Function: lowerstring(char *) * Description: changes the string that was passed to it to all * lowercase **********************************************************************/ /* void lowerstring (char *str) { while (*str != '\0') { if (isupper ((int) *str)) *str = tolower ((int) *str); str++; } } */


    Tuesday, May 28, 2013 3:45 PM
  • Hi,

    Welcome here.

    Try this link to see whether it helps: http://support.microsoft.com/kb/183370

    Have a nice day.

    Regards,


    Elegentin Xie
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Elegentin Xie Tuesday, June 4, 2013 1:04 PM
    Wednesday, May 29, 2013 3:30 AM
  • I have a VS 2010 C++ application that is developed as a console app.  When I build the application and run it on my developmetn PC, the application runs as expected.  When I take the EXE and put it on the server to be ran, I get an error code = 80004002, code meaning = No such interface supported

    I have .Net frame work 4.0 on the server, I installed the C++ 2010 redistributable files.  Still get the same error.

    Any ideas where to look next? 

    When I build a debug version and run it, it jsut gives an R6010 abort() has been called message.

    Below links may help you

    An ADO application does not run on down-level operating systems after you recompile it on a computer that is running Windows 7 SP 1 or Windows Server 2008 R2 SP 1 or that has KB983246 installed

    Breaking change in ADO update KB983246 (included in Windows 7 Service Pack 1)

    How To Develop with ADO Version 2.5 or Later and Install on ADO Version 2.0


    Thanks, Renjith V R

    • Marked as answer by Elegentin Xie Tuesday, June 4, 2013 1:04 PM
    Wednesday, May 29, 2013 11:27 AM
  • Hi,

    I have marked these replies as answers.
    If you disagree, please unmark it, and post your doubt.

    Regards,


    Elegentin Xie
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, June 4, 2013 1:05 PM