Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Struct

Posted on 1997-09-05
4
Medium Priority
?
249 Views
Last Modified: 2008-03-10
I'm trying to use the OFSTRUCT structure but when I declair the varible as:
OFSTRUCT source;
the program gives me error that the program can't convert the varible from _OFSTRUCT* to _OFSTRUCT.
0
Comment
Question by:JDS
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 3

Accepted Solution

by:
gaohong earned 100 total points
ID: 1168961
Compiler expects you pass a object instead of reference or pointer. Checking function protocol and arguments type

good luck
0
 

Author Comment

by:JDS
ID: 1168962
No I needed to put an * at the end of the struct def.
0
 

Author Comment

by:JDS
ID: 1168963
No I needed to put an * at the end of the struct def.
0
 

Expert Comment

by:hacksmith
ID: 1168964
The Ofstruct structure is there to provide you with info about an  open file. The structure therefore is filled for you by the operating system and what you need is the ready made pointer to it which is supplied by you when the file is opened. See help under OpenFile..

lpOpenBuff is the empty pointer you supply as an argument which is filled with the address of the OFSTRUCT structure.

The structure receives information about the file when it is first opened. The pointer to the structure can then be used in subsequent calls to the open file.

The answer therefore is

1. supply an empty pointer

OFSTRUCT* mypointer;

2. open the file using openfile and using mypointer among the arguments and then use that pointer which will have the address of the OFSTRUCT of the file.

You can create your own OFSTRUCT on the heap using the new operator, but it will be empty and not much use.

 
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question