Author Topic: argh - MFC problems  (Read 2176 times)

0 Members and 1 Guest are viewing this topic.

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
So I'm adding a function to FRED to allow imports of FSM mission files.  Everything's working quite nicely, except that if you have an existing mission open when you import, it keeps the old file name.  Nothing I try seems to clear it - even doing clear_mission, reset_mission, etc. numerous ways doesn't touch the mission filename stored in memory somewhere.  Needless to say, this is not desirable.  Someone could be not paying attention when FRED asks to save changes to the old mission -- just hitting OK would overwrite everything.

I'm almost fresh out of ideas, but I thought I might be able to hack an MFC call to just run File->New.  Trouble is, I can't find documentation anywhere that'll tell me how to do that. :mad: Any help?

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
I stumbled across a workaround, named something slightly different and hidden in the bowels of FRED. :rolleyes: :hopping:

 

Offline Sesquipedalian

  • Atankharz'ythi
  • 211
So, Fred really is as mean-spirited and twisted inside as they say?
Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

The Scroll of Atankharzim | FS2 syntax highlighting

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Nah, that's Microsoft.  FRED is a pain, but that's only because it includes MFC (Microsoft Foundation Classes).  Thanks to Volition's redundancy, if you can find a bit of code in FRED that does something similar to what you need, you can usually cut, paste, and hack until it works.  Building something from scratch, on the other hand -- you haven't learned masochism until you've tried to read a Microsoft help file.

Excerpt from a particularly infuriating help file I ran across when I was trying to puzzle out a problem in Access this summer...
Code: [Select]
[b]OpenRecordset Method[/b]

Creates a new Recordset object and appends it to the Recordsets collection.

[b]Syntax[/b]

[b]Set[/b] [i]recordset = object.[/i][b]OpenRecordset[/b][i](source, type, options, lockedits)[/i]

...

You can use one of the following constants for the [i]type[/i] argument.

Constant            Description
--------            -----------
[b]dbOpenTable[/b]         Opens a table-type [b]Recordset[/b] object
[b]dbOpenDynamic[/b]       Opens a dynamic-type [b]Recordset[/b] object
[b]dbOpenDynaset[/b]       Opens a dynaset-type [b]Recordset[/b] object
[b]dbOpenSnapshot[/b]      Opens a snapshot-type [b]Recordset[/b] object
[b]dbOpenForwardOnly[/b]   Opens a forward-only-type [b]Recordset[/b] object

...

I kid you not.  You get a huge pile of information dumped on you that tells you precisely nothing. :doubt:
« Last Edit: September 29, 2003, 03:13:32 am by 561 »

 

Offline Kazan

  • PCS2 Wizard
  • 212
  • Soul lives in the Mountains
    • http://alliance.sourceforge.net
MFC = the suck
wxWindows = kicks ass [and is platform independant]
PCS2 2.0.3 | POF CS2 wiki page | Important PCS2 Threads | PCS2 Mantis

"The Mountains are calling, and I must go" - John Muir

 

Offline Amon_Re

  • 28
    • http://www.kefren.be
MFC? Hell, even BOOPSI was more easy to use ;)

(Free beer to the one who knows *that* old beast)

Cheers
Sig? What sig?

 

Offline magatsu1

  • 210
*blatant lie*
I'm still using it. Honest.

where's my beer ?:hopping:
Blitzerland: Knows what he's talkin' about

 

Offline Amon_Re

  • 28
    • http://www.kefren.be
Quote
Originally posted by magatsu1
*blatant lie*
I'm still using it. Honest.

where's my beer ?:hopping:


So *what* is it? And on what Arch does it work? ;)

Cheers
Sig? What sig?

  

Offline Kazan

  • PCS2 Wizard
  • 212
  • Soul lives in the Mountains
    • http://alliance.sourceforge.net
Basic Object Oriented Programming System for Intuition
PCS2 2.0.3 | POF CS2 wiki page | Important PCS2 Threads | PCS2 Mantis

"The Mountains are calling, and I must go" - John Muir