The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Problem with AscImpReadFileStruct on single PC
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

klunz

Germany
Posts

Posted - 10/29/2009 :  09:45:25 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): Origin Pro 8G SR4 v8.0951 (B951)
Operating System: Windows XP

Hello everyone,

I have written a programm in OriginC that runs on all Workstations here without problems. Just on one Computer, which runs the same Origin Version and the same Windows XP like all the others, its not running.

I've narrowed the error down to the following section of code

	
string strFile = GetOpenBox("*.*", NULL, "", "Bitte Datensatz auswählen");	// Öffnet "Datei öffnen"-Dialog
if( strFile.IsEmpty() )							// Kontrolle ob Datei gewählt wurde
	{
		out_str("Bitte einen Datensatz auswählen!");
		return;
	}
string fileName = GetFileName(strFile);
printf(strFile);

Worksheet tabelleDaten("Daten");	// Erstellen der Daten-Tabelle
tabelleDaten.Create("Origin.OTW");
tabelleDaten.GetPage().Rename("Daten");
WorksheetPage PageDaten = Project.Pages();
PageDaten.Label = (fileName);
PageDaten.TitleShow = WIN_TITLE_SHOW_BOTH;
	
ASCIMP	ascimp;
	
if(AscImpReadFileStruct(strFile,&ascimp)==0)
{
	ascimp.nNumSep = test_numeric_separator(strFile);
}


The Error occurs in the section marked red, the if clause is not 0 but 1, and hence delivers an error.
The Error is reproducable on that computer, with different files, after restarts and so on, but it doesnt occur on any other workstation.
So, what could be the reason for it, I'm kind of lost....
Other then with the programm I wrote, the computer imports ascii-files just fine (when done manually).

Thanks a lot in advance

Tobi

cpyang

USA
1406 Posts

Posted - 10/29/2009 :  11:37:47 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Can you change your code to get the return value and let us know?


int nErr = AscImpReadFileStruct(strFile,&ascimp);
if(0==nErr)
   ascimp.nNumSep = test_numeric_separator(strFile);
else
{
   printf("AscImpReadFileStruct err:%d\n", nErr);
   // err handling
}



CP
Go to Top of Page

klunz

Germany
Posts

Posted - 10/30/2009 :  06:15:49 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello and thank you for your quick answer,

acutally, right now I'm sitting at the problematic workstation, but as the co-worker who is having the problem is not here, I'm loged in with my own account.
Everything works just fine.
So it seems its not a problem with the workstation, but rather with the one user. Maybe her User-Files are somewhat defect? Maybe this gives you another clue.

I'll probably get a chance to test the code you proposed on monday, I'll get back to you then.

Thanks again and have a nice weekend

Tobi
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000