|
hi,
can anyone tell me how to construct different string tables to be used for different languages and switching the language at start of program using resource dlls.
thanks
Varun Bhatt
|
|
|
|
|
|
Imagine an application that will have two documents. Eg : Doc1.txt & Doc2.txt. I need to view them both at the same time in a single window separated by a splitter. How should I design the application?
Some points to be considered.
1. There'll never be any need for another document Doc3.
Can I go for any static design that has only 2 docs?
2. I should have two independent "open file" menu item in the file menu to open Doc1 & another for Doc2.
Don't have any clue what's it all about. I just came out of SDI stuff. Now it's MDI's turn. Can someone through some light on sequence of steps that's need to achieve this requirement?
Thanks.
|
|
|
|
|
Leave it as an SDI app.
Have a 'composite document' type that represents the two documents as a single document (as far as MFC is concerned, it's a single document).
Have a single File->Open command that ensures two documents are opened to make a valid composite (the composite needs two documents, remember) but (if you want) have a UI that allows the user to open a document to replace one of the documents in the composite.
This way, you are retaining the single document<->view relationship that an MFC SDI app is built upon.
And yes, I've done this, for a tool I wrote that could either plot a file of data, or plot two files of data so that you got variables of the same name plotted on the same graph.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
The idea sounds very cool. Thanks a lot.
Also, rather than having a single File->Open command, what if I have two separate File-Opens and manage the composite document with global flags? I can open a document through "open 1st doc" & then signal the flag as "Opened through 1st file" similarly for 2nd doc. And once the 2nd doc is loaded, the composite doc is built. This way the user will be allowed to view just 1 doc or view both. Sounds feasible? Or something's fundamentally wrong with his idea?
|
|
|
|
|
grassrootkit wrote: manage the composite document with global flags
The word 'global' always rings alarm bells If they're part of the document class, that's probably better.
grassrootkit wrote: I can open a document through "open 1st doc" & then signal the flag as "Opened through 1st file" similarly for 2nd doc. And once the 2nd doc is loaded, the composite doc is built. This way the user will be allowed to view just 1 doc or view both. Sounds feasible?
Probably - I had a single document for both the 'single file' and 'two files' cases. The document knew what sort of document it was (one or two files), and managed things appropriately.
It all depends what the requirements are really.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Stuart Dootson wrote: The word 'global' always rings alarm bells
lol yes that would. Actually I planned to bring it in into the design. But to quickly explain you about what I thought I meant them as global. Anyway thanks a lot.. let me get into the lab .
|
|
|
|
|
I want to remove the character '=' and substring "%%&&**" from an input string s. The code below work fine, but if there are multiple substring, the code will only remove the substring once.
#include <stdio.h>
#include <string.h>
char *Mystrcpy1(char *s, const char *cs);
void func1(char *src, char *sub);
int main(void)
{
char s[32], *substr = "cc";
Mystrcpy1(s,"aabbccdd");
printf("From the string: \"%s\"\n",s);
printf("We will attempt to remove substring \"%s\"\n",substr);
func1(s,substr);
printf("Using function Mystrcpy1. The result: \"%s\"\n\n",s);
return 0;
}
char *Mystrcpy1(char *s, const char *cs)
{ /* Copy from beginning of string cs to the end */
char *s1;
const char *cs1;
for(s1 = s,cs1 = cs; '\0' != (*s1 = *cs1); s1++,cs1++) ;
return s;
}
void func1(char *src, char *sub)
{ /* Using function Mystrcpy1 */
char *p;
if ((p=strstr(src,sub)) != NULL)
Mystrcpy1(p,p+strlen(sub));
return;
}
|
|
|
|
|
nyc_680 wrote: The code below work fine, but if there are multiple substring, the code will only remove the substring once.
Repeating the process (until there is no match found) will help you.
- ns ami -
|
|
|
|
|
where should I put the repeting function at?
|
|
|
|
|
void func1(char *src, char *sub)
{ /* Using function Mystrcpy1 */
char *p;
if ((p=strstr(src,sub)) != NULL)
Mystrcpy1(p,p+strlen(sub));
return;
}
instate of this use
while((p=strstr(src,sub)) != NULL)
Mystrcpy1(p,p+strlen(sub));
|
|
|
|
|
Hi i am creating a SAFEARRAY of User define datatype i.e a structure which i described in my .idl file .
Now while creating a SAFEARRAY i have done this ..
IRecordInfo *pRecInfo = NULL;
//CIHPCRInjectorBarcodeData - is my structure
const GUID UUID_CIHPCRInjectorBarcodeDataStruct = __uuidof(CIHPCRInjectorBarcodeData);
shr = ::GetRecordInfoFromGuids (LIBID_HPCRInjectorSetupGTIS45Lib ,
1,0,0 ,UUID_CIHPCRInjectorBarcodeDataStruct ,
&pRecInfo );
SAFEARRAYBOUND rgsBound[1]; //This is one dimensional array.
long *pData;
long lValue , lIndex ;
rgsBound[0].lLbound = 0;
rgsBound[0].cElements = 8 ;
//Now Create SAFEARRAY
SAFEARRAY *psa = 0;
psa = ::SafeArrayCreateEx (VT_RECORD ,1,rgsBound,pRecInfo);
while debugging i found that elements are not getting initiallized ..
Please help
|
|
|
|
|
pandit84 wrote: while debugging i found that elements are not getting initiallized
Define initialised. If you're expecting SafeArrayCreateEx to copy elements into the array for you, I think you're expecting too much. I think you'll find it just uses the IRecordInfo interface to determine how much storage the SAFEARRAY needs.
Have you seen this example[^]?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Thanks...
i have created and used succesfully...
Thanks a lot
|
|
|
|
|
I am using VC++ 6.0 for developement.
I want to know how to find audio file advance properties like "Album","genre" etc
Please let me how to do this in vc++ 6.0
|
|
|
|
|
Different audio files like MP3, WAV, WMA, RA etc. etc. have different file formats.
The properties that you mentioned will be stored in different locations in different file formats.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
I need to read a MP3 file.
Please let me know how to do this task
modified on Monday, March 2, 2009 1:05 AM
|
|
|
|
|
I'm pretty sure most audio files store properties like this in id3 tags....
I think id3lib [^] is an opensource C++ api.
|
|
|
|
|
|
Hi all,
I have SDI type application.I want to handle Show Desktop from all options.
like from Quick Launch option,Wnd+D,Show the Desktopn From TaskBar menu, etc.
please can u tell me solution for this.
how can handle all options of show desktop.
please explain me with example.
thanks in advance.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
What do you mean by "Show Desktop from all options." ?
|
|
|
|
|
I mean all options those are use in Window to show desktop.
Like Wnd+D,Show desktop shortcut,Show desktop shortuct in Quick launch,Show desktop option of Taskbar Menu.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
"_$h@nky_" wrote: Like Wnd+D,Show desktop shortcut,Show desktop shortuct in Quick launch,Show desktop option of Taskbar Menu.
All these functions are going to call the same function that iterates through every window handle & minimize them right? Just a ShowWindow(MIN) would do that right? What extra functionality do you think a "show desktop" is doing other than minimizing all windows?
|
|
|
|
|
Ok,Please tell me how can i know when any one of this is called.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|