|
Currently I have a string [zPart] which would look something like the following “*(-2)”
I need to isolate everything inside the brackets “( …)” so it can be used later (in this case the –2).
My main goal is to replace * by an integer and perform the arithmetic inside the “(…)” on it. This will generate my finale value.
Any clues on how this could be implemented?
|
|
|
|
|
The answer depends largely on what compiler you are using.
If you are stuck using ansi-C there is a well known set of functions that are used for such string parseing needs. Look here[^]
MFC,.NET etc, generally provide similar functionality as part of their framework.
|
|
|
|
|
is this[^] help ?
TOXCCT >>> GEII power
|
|
|
|
|
Currently I have a string [zPart] which is either “*” or an integer value.
To differentiate between the two I do the following:
if (zPart == "*")
do something
else
do something else
This works great for now however I want to expand the functionality by allowing [zPart] to be something other then just “*”, for example “*(-2)”.
So I need a way to say the following [pseudo-code]:
if (zPart has a “*” in it)
do something
else
do something else
How would one implement this in C++?
Thanks,
|
|
|
|
|
|
Im new to C++ so sorry for this braindead question but (probably because its so basic) I cant find a solution to it. I have a Win32 app and I would like it to fill up the entire screen without a title bar. Is there something I can do when I call the CreateWindow function to make my app do this? If not how would I go about this?
Thanks!
|
|
|
|
|
|
Hello,
I just got a rude awakening when creating an app in my new VB.net IDE: anything created there requires that the end user download and install the ENTIRE .net framework! This wasn't the case in my VB 6.0.
So, does this also apply to VC++.net? Will VC++.net allow me to statically link the libraries so that I don't kill my users with a burdoning installation?
thanks,
JennyP
|
|
|
|
|
C++ is the only language that the .NET compiler can natively compile. That is to say, unless you use managed C++ ( and why would you ? ), there's no need ( and indeed no use ) in installing the .NET framework on a client machine.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Do someone have some message flow (something like PostMessage with WM_CHAR) to simulate copy/paste (CTRL-C CTRL-V) within an application ?
tx anyway
GuimaSun
www.nexsun.com.br
NEXSUN TechZone
|
|
|
|
|
Are you talking about the WM_COPY and WM_PASTE messages?
"Opinions are neither right nor wrong. I cannot change the opinion you have of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
David, the problem with these messages is it just works in a edit control or combo box or some control that treats them, so AFAIK I have to simulate CTRL-C/CTRL-V which works with any situation
Thanks anyway.
|
|
|
|
|
What type of control are you trying to copy from or paste to?
Anonymous wrote:
...I have to simulate CTRL-C/CTRL-V which works with any situation
You could always use SendMessage(WM_CHAR, ...) to send the Ctrl+C and Ctrl+V keys.
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I have a system wide DLL Hook which filter keypressing to a serie of personal functions, one desired would be copy/paste...so it must work whitin any context, a selection made on a textbox, on a web page, etc.
I agree the way is SendMessage(WM_CHAR, ...) thats the point I have to research the entire message flow, but for sure someone already did it before
Thanks again
GuimaSun
www.nexsun.com.br
NEXSUN TechZone
|
|
|
|
|
I am using the IE Web browser control to load and display some html pages that are resources in my program.
I notice that if I load a page that has a "link" tag specifying a style sheet the first time then I can properly enumerate through the document's DOM and get at various items. *But* if I load it again, then suddenly the DOM only contains the HTML, HEAD, TITLE, and LINK tags.
However if I remove/comment out the LINK tag then everything is fine! Argggg!!
Anyone have any suggestions how to work around this?
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
Dear friends,
I want to associate a menu to a dialog. So i created a simple dialog appliation. In resource editor, i created a menu item "&File" . Thus, in resource editor the letter "F" in "File" becomes underlined.
In OnCreate(), i used LoadMenu() and SetMenu() to associate menu with the dialog.
So far so good. But when i run my application, the menu appears on the dialog, but the "hot key character" is not underlined. When i press "Alt" key, it suddenly becomes underlined. Can anyone tell me why the hot key characted is not underlined by default as in other windows applications ??
Imtiaz
|
|
|
|
|
Hiding the underlines is a fairly standard Windows feature - I'm running Win2K here, and the IE browser window I'm currently typing in has no underlines until the Alt key is pressed - there's probably some underlying option you can change in your application, but why would you want to?
--
Help me! I'm turning into a grapefruit!
Phoenix Paint - back from DPaint's ashes!
|
|
|
|
|
I'm currently working on implementing a namespace extension. The information I store in the PIDLs that I'm using comes from a database that has entries for every file and folder I want to be displayed inside of the extension. Currently I have my extension displayed on the desktop and all of the correct entries, along with my custom display information, are shown in the explorer. What I am having trouble with is implementing the Open and Save As dialog boxes to use my folder and its contents.
Problem #1: My extension displays in the Open dialog selection box for every program, but when I click on it I get a list of the folders it contains and no way to browse to the items that the folder contains. I believe that I have the correct flags set for these folders and files (SFGAO_FILESYSTEM, SFGAO_FILESYSANCESTOR, SFGAO_BROWSEABLE).
Problem #2: The files that I link to via my extension are encrypted files that need to be decrypted and saved to some sort of temp file so that the user can open them in various programs. I only want to decrypt these items when the user clicks Open in the dialog box. The file should then be decrypted to the file type that was selected in the Open dialog box (if it is a file type that is supported by the encrypted file).
I'm starting to think there is a possibility that I have not implemented an interface that I should have, but I am unsure of which interface that I need to implement. Currently I have implemented IClassFactory, IContextMenu, IEnumIDList, IExtractIcon, IShellFolder, IPersistFolder, IShellView and IOleCommandTarget.
Any information about how to implement the Open and Save As dialog boxes with namespace extensions would be appreciated.
|
|
|
|
|
Hello, I am currently working on a project, also, I am new to code project. Anyways, I have done HTML before, and I know that when a button is clicked in HTML, you can assign code to it, to have it connect to wherever you want. In MFC, I have three classes created. One is the ATM class (when the program is run, it starts here), the other two are the checking and savings class. When the ATM dialog comes up, there are two buttons, the checking and savings button. Basically I want to make it so that when the savings button is clicked in the ATM dialog, it SWITCHES to the savings dialog. And the same with the checking button. ANY help would be greatly apprecited. Please.
|
|
|
|
|
Use the ClassWizard to associate an action with the click of the buttons.
It will make a stub function for eahc button, within the stub fucntion for each butotn, invoke the dialog you want.
|
|
|
|
|
I havent used MFC before, so I beg of you, could I please have step by step instructions?
|
|
|
|
|
It's got nothing to do with MFC, it's your IDE. I think if you click on the button in the desiginer, you'll get a drop down list along the menu bar, if you choose a message, it is added. Otherwise, I'm pretty sure that double clicking on the button in the designer will add it. If you're using VS.NET 2002 or 2003, the properties window ( right click and choose properties if you can't see one ) has a little lightning flash icon. This will list all messages possible to override via the IDE for the selected control. Find 'onclick' ( or 'click' maybe ) and in the text box, put a name for your message handler, and it will be added for you.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Also, how do I invoke the dialog I want?
|
|
|
|
|
Read the C++ FAQ before asking any more of these questions, please.
MyDialog dlg;
if (dlg.DoModal() == ID_OK)
{
// do stuff here.
}
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
I'm by no means a top-of-the-line VC programmer. I asked a question yesterday about testing my skills and got a reply that the best way would be to do some work in finding and fixing a hard bug in a commercial app. So if anyone has an app that they're working on that has a bug they can't find, send me an e-mail and if you want, I'll reply so you can send me the source. I don't want any money (my name in the code or acknowledgement somewhere would be nice). If I'm able to do this it won't be top priority, as I do have an actual job that I also have to do. But in my spare time, I wouldn't mind trying to fix some stuff.
Who are all these people and what are they doing in my house?...Me in 30 years, inside a grocery store
bdiamond
|
|
|
|