HyperFile->Open(..) fails ..

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 16/09/2010 at 03:41, xxxxxxxx wrote:

User Information:
Cinema 4D Version:   R12 
Platform:   Windows  ; Mac  ;  Mac OSX  ; 
Language(s) :     C++  ;

---------
Hi,

for some reason openig a hyperfile does not work anymore, even though the file positively exists.
Maybe I'm doinf sth wrong, I'm also not 100% sure how to use the new 'LONG ident' argument of HyperFile::Open(..)

Here's the code, that worked fine with previous SDK's :

  
.  
.  
      
    if(!GeFExist(fn)){  
          GePrint("specified preset does not exist, falling back to 'default.win'");  
          fn.SetDirectory(GeGetPluginPath()+ Filename("presets")+Filename("windows"));                          
          fn.SetSuffix("win"); fn.SetFile(Filename(defaultWindow));  
      }  
      else{  
          GePrint(fn.GetString()+" exists!");  
      }  
  
    AutoAlloc<HyperFile> hf;  
  
  #if API_VERSION > API_R11      
      LONG ident = 1L; // not sure how to use this ..  
      if (hf->Open(ident,fn,FILEOPEN_READ,FILEDIALOG_ANY)) // fails ´-(  
  #else  
      if (hf->Open(fn,FILEOPEN_READ,'temp')) // works :-)  
  #endif  
      {  
          Bool success = hf->ReadContainer(&data,TRUE);      
.  
.  
.  

thx,
  Daniel

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 16/09/2010 at 09:14, xxxxxxxx wrote:

hmm, look ok to me. what does the compiler say exactly with the failed function call? Or does it compile fine and it´s not loading? Did you check the path with debugging?

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 16/09/2010 at 09:50, xxxxxxxx wrote:

Hi,

it compiles fine, it's just that that hf->Open() returns false.
The file path is ok i think, i print it to the console and its just as it should be and GeFExist() returns
true. Also when i use BaseFile instead of HyperFile, Open() returns true, so it should indeed be ok.

I need to use a hyperfile though, bc i want to call hf->ReadContainer()...

Do you know what the 'ident' argument is for ? Is this just like an arbitrary handle or sth that you can use to refer to the file later on, or do i need to set this to sth specific ?

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 16/09/2010 at 09:56, xxxxxxxx wrote:

hmm, strange. The code is fine imo (yes, afaik ident is just an identification handler. Your code should work. of course the hyperfile should have been stored with that same identity!).

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 16/09/2010 at 10:07, xxxxxxxx wrote:

Originally posted by xxxxxxxx

<ADDRESS>
User Information:
Cinema 4D Version:   R12 
Platform:   Windows  ; Mac  ; 
Mac OSX  ; 
Language(s) :    
C++  ;

---------
</ADDRESS>
Hi,for some reason openig a hyperfile does not work anymore, even though the file positively exists.Maybe I'm doinf sth wrong, I'm also not 100% sure how to use the new 'LONG ident' argument of HyperFile::Open(..)

Ident is the same in r12 and r11.5; you just haven't realized, that you already used it in r11.5 .-) In r11.5 the hyperfile method was called with:

Bool Open(const Filename& filename, LONG mode, LONG ident)

Now it is:

Bool Open(LONG ident, const Filename& filename, FILEOPEN mode, FILEDIALOG error_dialog)

Best regards,

Wilfried Behne

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 16/09/2010 at 13:22, xxxxxxxx wrote:

lol, yes you're right i actually used the argument before without noticing..
and indeed, when i change the argument ident from 1L to 'temp' it works..

thx guys!