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 AddSubfolder
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

EastWestTrav

Azerbaijan
Posts

Posted - 01/30/2007 :  1:51:10 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7.5G SR6
Operating System: win xp


Following code doesn't work:

void NewDirForme()
{
Folder fld = Project.GetPath();
fld.AddSubfolder("mydir");
}


Compiling goes well, but executing the code I get the message (translated):
Runtime error in Origin C function, object could not find method

Mike Buess

USA
3037 Posts

Posted - 01/30/2007 :  2:27:41 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Works fine for me in same Origin version. This function is essentially the same as pe_mkdir in LT_PE.c. Does that function work for you?

Mike Buess
Origin WebRing Member
Go to Top of Page

EastWestTrav

Azerbaijan
Posts

Posted - 01/31/2007 :  05:28:48 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
pe_mkdir creates a new folder inside the project own folder structure.

I don't know what's wrong but following code works for me:

quote:
void NewDirForme()
{
string c=Project.GetPath() + "mydir";
printf("%s \n", c);
CheckMakePath(c);
}
Go to Top of Page

Deanna

China
Posts

Posted - 02/01/2007 :  12:00:40 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I tried your code on 7.5G SR6.., It works fine. I don't know what happens. If this problem persists or there is other problems, please consider reinstalling Origin.

Deanna
OriginLab Technical Services
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 02/01/2007 :  10:23:53 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
OK, I understand now. Folder fld declares a Project folder and has nothing to do with disk folders. Similarly, fld.AddSubfolder() creates a Project folder whereas CheckMakePath() creates a disk folder (if it doesn't already exist). Your original code works if the project has not been saved so that Project.GetPath() is empty. It fails as you describe if you try it in a saved project.

Mike Buess
Origin WebRing Member
Go to Top of Page

EastWestTrav

Azerbaijan
Posts

Posted - 02/02/2007 :  07:06:17 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I understand. The main point is that I mixed up disk folder and Origin's internal folder structure. I didn't read the description of the class "folder", but only the one for .AddSubfolder
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