FAQ available??

FAQ available??

Post by Paul.Soderl.. » Wed, 15 May 1996 04:00:00



Hi,

I want to use os/2 file dialog box in my C program (gcc), and I have no
idea of how to do that. Is there a FAQ or any other simple introduction/sample
code available on the net?

**********************************************
Paul Soderlind
IIES
Stockholm University
S-106 91 Stockholm
Sweden
Tel: +46-8-163564
Fax: +46-8-161443

Home page: http://www.iies.su.se/data/home/soderlip/homepage.htm

 
 
 

FAQ available??

Post by Cindy Ro » Sat, 25 May 1996 04:00:00



>Hi,

>I want to use os/2 file dialog box in my C program (gcc), and I have no
>idea of how to do that. Is there a FAQ or any other simple introduction/sample
>code available on the net?

Here is something to get you started:

FILEDLG filedlg = { 0 };
if ( I-want-an-Open-dialog )
{
   filedlg.cbSize = sizeof(filedlg);
   filedlg.fl = FDS_CENTER | FDS_ENABLEFILELB | FDS_OPEN_DIALOG;
   filedlg.pszTitle = "Open...",
   filedlg.pszOKButton = "~Open";
   strcpytoarray( filedlg.szFullFile, filename );

Quote:}

else if ( I-want-a-Save-dialog )
{
   filedlg.cbSize = sizeof(filedlg);
   filedlg.fl = FDS_CENTER | FDS_ENABLEFILELB | FDS_SAVEAS_DIALOG;
   filedlg.pszTitle = "Save to...";
   filedlg.pszOKButton = "~Save";
   strcpytoarray( filedlg.szFullFile, filename );

Quote:}

if ( ! WinFileDlg( HWND_DESKTOP, hwnd, &filedlg ) )
{
   // error occurred
Quote:}

else if ( filedlg.lReturn != DID_OK )
{
   // user cancelled dialog
Quote:}

else
{
   // okay, open filedlg.szFullFile

Quote:}

-------------------------------------------------------------

(These opinions are just mine, I only represent myself, etc.)
-------------------------------------------------------------

 
 
 

FAQ available??

Post by Rob McCaffer » Sun, 26 May 1996 04:00:00




>>Hi,

>>I want to use os/2 file dialog box in my C program (gcc), and I have no
>>idea of how to do that. Is there a FAQ or any other simple introduction/sample
>>code available on the net?

>Here is something to get you started:

>FILEDLG filedlg = { 0 };
>if ( I-want-an-Open-dialog )
>{
>   filedlg.cbSize = sizeof(filedlg);
>   filedlg.fl = FDS_CENTER | FDS_ENABLEFILELB | FDS_OPEN_DIALOG;
>   filedlg.pszTitle = "Open...",
>   filedlg.pszOKButton = "~Open";
>   strcpytoarray( filedlg.szFullFile, filename );

FILEDLG filedlg = { 0 };
Doesn't that only set the FIRST FIELD in the structure (cbSize) to 0?
Shouldn't you use memset(&filedlg, 0, sizeof(FILEDLG)) instead?

I only noticed this because I just spent a half hour debugging because I
forgot to fill the structure with zeros!


 
 
 

FAQ available??

Post by Cindy Ro » Wed, 29 May 1996 04:00:00



Quote:

>FILEDLG filedlg = { 0 };
>Doesn't that only set the FIRST FIELD in the structure (cbSize) to 0?
>Shouldn't you use memset(&filedlg, 0, sizeof(FILEDLG)) instead?

>I only noticed this because I just spent a half hour debugging because I
>forgot to fill the structure with zeros!

The C++ Programming Reference (Stroustrup) says "If there are
fewer initializers in the list than there are members of the
aggregate, then the aggregate is padded with zeros of the
appropriate types".

Not sure about plain C...

-------------------------------------------------------------

(These opinions are just mine, I only represent myself, etc.)
-------------------------------------------------------------

 
 
 

FAQ available??

Post by Jack S. T » Wed, 05 Jun 1996 04:00:00



>The C++ Programming Reference (Stroustrup) says "If there are
>fewer initializers in the list than there are members of the
>aggregate, then the aggregate is padded with zeros of the
>appropriate types".
>Not sure about plain C...

ANSI C says:

    "If there are fewer initializers in a brace-enclosed list than
    there are members of an aggregate, the remainder of the aggregate
    shall be initialized implicitly the same as objects that have
    static storage duration."

Earlier:

    "If an object that has static storage duration is not initialized
    explicitly, it is initialized implicitly as if every member that
    has arithmetic type were assigned 0 and every member that has
    pointer type were assigned a null pointer constant."

--

Jack Tan

[TEAM OS/2]

 
 
 

1. Process Commander FAQ Available!

Stardock's website now has a very thorough FAQ available on Process
Commander.

It should answer many of the questions users have on this next utility.

Our website is: http://www.stardock.com

Brad

--
----------------------------------------------------------------------------
---------
Brad Wardell, Project Manager: Entrepreneur!
Stardock Systems, Inc.
Developing next generation software!
http://www.stardock.com    orders:1-800-672-2338
----------------------------------------------------------------------------
---------

2. Vertex Cover reduction to K-medians clustering ?

3. OS/2 Warp FAQ available

4. How to write a loader in assembly?

5. REXX FAQ available

6. ISDN vendors and ISP's wanted for OS/2 User Group Meeting

7. *** OS/2 FAQ Available via e-mail ***

8. Help with modem transfer

9. Is there an os/2 faq available?

10. new hardware FAQ available

11. Road Runner Cable Modem Setup in OS/2 Warp 4 - FAQ Available?

12. FAQ Available / Dual boot OS2-WIN

13. Road Runner Cable Modem Setup in OS/2 Warp 4 - FAQ Available?