|
That's what really I want.
How to define my own file format.
|
|
|
|
|
At first you should think on how do you want to store that data, then serialize that data into a file using a function that encapsulates the way you want to do it. In fact, you could generate a "document" class with a load and save functions.
You can make it as complicated as you want by applying encryption methods and others, but you must decide how to do it.
In fact if you want to generate some kind of file that only your application must be able to open and understand, you should decide how do you want to store that data without thinking on making it standard in any way.
If you want to open that file automatically with your application then register the file extension.
Hope this helps.
|
|
|
|
|
There are many different ways. For instance if you want to store point coordinates you can create a structure like this
struct Point
{
double x;
double y;
};
and store all points you have consequentially in the file. There are different ways of doing that too. The simplest is using <stdio.h>
FILE* f = fopen("test.dat","bw");
fclose(f);
modified 8-Mar-17 3:51am.
|
|
|
|
|
Thanks for suggestions!
Thank you.
|
|
|
|
|
poda123 wrote: Does any one know how to create a .dat file.
In exactly the same way as you would any other file. A file's extension has no bearing on how it is created.
poda123 wrote: The file should only be opened using specified program and
not by other editors.
This is rather difficult, if at all, to achieve.
poda123 wrote: For example,Yahoo messenger archieves are stored in
.dat file format.
But that does not imply that YM could open any .dat file, only those that it created.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hello Friends,
I want to change the Cursor when mouse is on Button.
This I want to do in ATL.
Abhijeet
|
|
|
|
|
You Can use SetCursor . Use CComModule::m_hInst as first parameter.
|
|
|
|
|
Alternatively, you can derive a class from CButton, implement a static method RegisterClass that will retrieve the BUTTON class info using GetClassInfo(Ex), then replace the class name with your class name, window procedure with yours and also the class hCursor with the desired cursor.
A similar technique can be found in MSDN for custom dialog classes.
|
|
|
|
|
Hi All
Is there any alternative function for atof() which accept wchar_t datat and convert to float.
Thanks
Atool
Atool
|
|
|
|
|
_wtoi
you can find it, togheter with _ttoi , the generic one, in MSDN, if you search for atoi , haven't you?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
CPallini wrote: _wtoi
How does that relate to floating-point numbers?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Sorry I was sure we were talking about atoi !!
It seems that atof has not a wide-string cousin.
Workarounds, I guess, maybe:
(1) using WideCharToMultiByte and then atof .
(2) using swscanf
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
The C runtime reference lists all the forms of functions including a table with the generic
text versions.
F1 is your friend
try _wtof
|
|
|
|
|
Hi
I want to add a com dll in my c++ project. I also post this query before and one experts suggets me to use explicit linking
and i follow the suggested steps.But now object of dll has been created but it disply exception.
i psate the code here
#import "Redemption.dll" no_namespace
HRESULT In=CoInitialize(NULL);
if ( SUCCEEDED ( In ) )
{
IRDOSession* Session=NULL;
iRDOStoresPtr ptr;
HRESULT hr =CoCreateInstance( __uuidof(RDOSession),
NULL,
CLSCTX_INPROC_SERVER,
//CLSCTX_LOCAL_SERVER,
__uuidof(IRDOSession),
(void**) &Session
);
if ( SUCCEEDED ( hr ) )
{
// Call methods using pISL here.
//Session->Logon(" ",NULL,NULL,NULL,NULL,NULL);
ptr=Session->Stores->AddPSTStore("c:\w.pst",NULL,"New");
}
Session->Release();
CoUninitialize();
}
the object is accessing all members but when called it display exception.
Plz tell what the prblem is.I got confused.
manu
|
|
|
|
|
manu_2205 wrote: ptr=Session->Stores->AddPSTStore("c:\w.pst",NULL,"New");
Try to replace the \ character with a double backslash (\\)
You should get at least a compiler warning, since escape-w isn't a valid escape character (or is it?).
Stores->AddPSTStore("c:\\w.pst",NULL,"New");
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
I try Again it display exception.
Even it has a Logon() function .It also disply run time error.
I am not getting what the problem is .
When i debug the application it open .tli file and disply exception.
manu
|
|
|
|
|
I want to tell that
IRDOSession :- is a interface
RDOSession:-It is coclass
manu
|
|
|
|
|
Hi manu,
try passing BSTR or unicode strings as the parameter value.
do not pass strings like "" etc,
give some value like L"myValue".
^-^
@|@
- redCat
|
|
|
|
|
What function?Whats values of input this function and what return value?
|
|
|
|
|
hi friends,
I got a problem while using this mciSendCommand(....) function. Actually I want to play PAL video files so I used the MCI_SETVIDEO using mciSendCommand(...) function for setting it as PAL video but I am getting the error returned from that function as MCIERR_MISSING_PARAMETER
void InitialiseMCIWindow()
{
UINT ut;
MCI_GENERIC_PARMS gen;
if((c_Player=MCIWndCreate(hwndParent,AfxGetInstanceHandle(),
WS_CHILD | MCIWNDF_SHOWNAME |
MCIWNDF_SHOWMODE |
WS_VISIBLE , m_sPath))==0)
MessageBox("Error in initialise");
gen.dwCallback = MCI_DGV_SETVIDEO_ITEM | MCI_DGV_SETVIDEO_SOURCE | MCI_DGV_SETVIDEO_SRC_PAL ;//
ut = MCIWndGetDeviceID(c_Player);
MCIERROR err = mciSendCommand((MCIDEVICEID)ut,MCI_SETVIDEO,MCI_NOTIFY,(DWORD_PTR) (LPMCI_GENERIC_PARMS) &gen);
if( MCIERR_MISSING_PARAMETER == err )
MessageBox("Error Got");
// if(err == 0)
// MessageBox("Success");
// else
// MessageBox("Failed");
.............
}
Can anyone help me with this problem???
With regards
Raja Bose
|
|
|
|
|
Just a thought, does gen need to be initialised?
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
first of all i like to thank u for replying ....
Still i am getting the error message even without gen initialisation ... without gen initialisation can u tell me how to set the source video as PAL
Thank u,
With regards
Raja Bose
|
|
|
|
|
I'm not very familiar with the commands, but according to MSDN http://msdn.microsoft.com/library/default.asp?url=/library/en-us/multimed/htm/_win32_mcisendcommand.asp[^]
the command looks like this:
MCIERROR mciSendCommand(
MCIDEVICEID IDDevice,
UINT uMsg,
DWORD fdwCommand,
DWORD_PTR dwParam
);
where dwParam is a pointer to a structure that contains parameters for the command message.
So the command itself is contained in the struct.
Try to find a sample and start from there. Good luck.
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
gen.dwCallback should be the HWND of the window to receive the notification message when the
command completes since you're using MCI_NOTIFY.
the MCI_DGV_xxx flags should be combined (OR'd) with MCI_NOTIFY in the third param to
mciSendCommand().
Mark;
|
|
|
|
|
first of all i appreciate your kind help
Thank u very much for replying ..... Its working fine ....
Thanks a lot............
With regards
-- modified at 6:54 Thursday 4th January, 2007
Raja Bose
|
|
|
|