|
I use the class CTreeCtrl Created a Tree Control.
With the member function SetImageList() I can set images to the tree contrl.
Now,I want to change the image in a paticular TREEITEM,and there is no such function.
How can do that?
Thanks
Bruspark
|
|
|
|
|
|
Friends,
I've a property sheet with two property pages. What i want is that, whenever the user tries to swich to the second page, the data in the controls of current page should be validated and if the data is wrong, user should remain in the current page and not switch to the other page. How can i do so ?
Imtiaz
|
|
|
|
|
|
can anyone tell me how do I remove a substring from a string, like i have "abc.xml" and i want to remove ".xml" from it and in turn just get abc. How do i do it?
|
|
|
|
|
Type something like this. Again I haven't tested this.
---------------------------------------
string::size_type LastDotPos = YourString.find_last_of('.');
if ( LastDotPos != -1 )
{
string BeforeDot = YourString.substr(0, LastDotPos);
}
Steve
|
|
|
|
|
can anyone tell me how to check whether a particular substring is present in a given string or not? I have a string containing file name and I have to check whether the file is an xml file or not. So I have to look for ".xml" substring in that given string. How do we do that?
|
|
|
|
|
Try something like this. NOTE: I haven't tested this so your mileage may vary:
----------------
string::size_type LastDotPos = YourString.find_last_of('.');
if ( LastDotPos != -1 )
{
string Extension = YourString.substr(LastDotPos);
transform(Extension.begin(), Extension.end(), Extension.begin(), ::tolower);
if ( Extension == ".xml" )
{
// Ends in ".xml".
}
}
Steve
|
|
|
|
|
Hello,
I currently working on a program. Suprise, suprise. And this program has to wait for a client to connect and then do something with the client. I put the wait for client, etc. stuff into a thread so that my interface is still useable, but since it's a thread my main program continues running. How can I prevent this ? So the Interface of my Main Program should keep useable but it should not continue work till a client connected.
Any Ideas or Suggestions ?
With best regards,
Benedikt
|
|
|
|
|
RedDragon2k wrote: my main program continues running
Wasn't that the whole idea of making another thread? I assume you mean you don't want the user to be able to use the UI? If this is the case just disable the main window or bring up a modal "please wait" dialog that is dismissed when the worker thread is done by sending a WM_CLOSE message to it.
Steve
|
|
|
|
|
Hello,
nice ideas. But I think they won't work, because the my app does are done silent. All in all just want the UI to be drawn correctly. And the possibility to stop the work (so interaction).
Hope this helps,
Benedikt
|
|
|
|
|
Can you use ::WaitForSingleObjectEx(...) function?
|
|
|
|
|
If he uses this API the UI will not redraw properly while the worker is running.
Steve
|
|
|
|
|
That is easy just do not return from the thread util a client has reacted. No wait a client may never react and then you end up with an infinite loop.
There are multiple ways to provide a solution to this problem, the simpilest is to disable all commands that require the client to communicate with you. That is anything that is not be dependent on an outside source, like close application. The main thread should never be disabled, because you always need the option of shuting down the program.
INTP
“Testing can show the presence of errors, but not their absence.”
Edsger Dijkstra
|
|
|
|
|
I have an API with code distributed over several DLL's. I now want to create a single DLL with functions which will be forwarded to the several existing DLL's. Very much on the same line as the Windows Kernel.DLL is implemented. Do I have to write code to generate such thing, or, are there settings in the VCPP IDE to achieve this the Microsoft way.
I am thinking of something like:
_MyFunction=Existing.Dll:?MyFunction@YKKKK@Z
LateNightsInNewry
|
|
|
|
|
You've kinda answered your own question:
"I now want to create a single DLL"
"Do I have to write code to generate such thing"
You have to write the dll.
However, it sounds like you could write a tool to generate the code from a config file with the mappings the way you want (_MyFunction=Existing.Dll:?MyFunction@YKKKK@Z).
...cmk
Save the whales - collect the whole set
|
|
|
|
|
cmk wrote: You've kinda answered your own question:
No, I've Not, you don't understand the question!
The Windows KERNAL.DLL is implemented by sending a Call to each function on to another DLL within the appropriate operating system. Kernal.DLL actually does not contain any excecutable code. There is also no secret about the Binary part of Forwarding. Microsoft has implemented this mechanism for donkies years, it ensures that a 32 bit PE Binary runs equally on systems from Win95 thru Win 2000.
The question is: Is there an existing tool to Achieve this:-
i.e.:
- Do I Achieve this through some obscure settings in the Projects\Settings Dialog? (Use a Microsoft Tool)
- Do I achieve this through some obscure .DEF File Syntax (Use a Less Known Microsoft Tool)
- Is the Only way to achieve this by writing Code which during Run time generates a Binary of a DLL to achieve the result (Develop my Own Tool)
I Will develop my Own Tool if required, but, before embarking, would like to know if there is any need to do so.
LateNightsInNewry
-- modified at 21:11 Saturday 22nd April, 2006
|
|
|
|
|
LateNightsInNewry wrote: No, I've Not, you don't understand the question!
Calm down, actually i do understand the question.
You mention that you found somewhere else that you can use a def file and use _MyFun=NTDLL.?Another@YKKKk@Z syntax.
I am well aware of how to use a def file, however, redirection to another module is not documented in MSDN:
http://msdn2.microsoft.com/en-us/library/hyx1zcd3(VS.80).aspx[^]
As far as i was concerned you could only use the "=" syntax to rename an export within the given module.
I'll be interested to see if <export name="">=<module>?<function|data> syntax works (actually i think i'll try whipping up a small test now).
You use "NTDLL." as the module name - can you specify the extension e.g. "MYMOD.DLL" or "MYMOD.EXE" (for cases where both a dll and exe may exist with the same name) ?
[EDIT]
Actually a quick search found (and others):
http://www.osix.net/modules/article/index.php?id=728[^]
I had assumed you would have to do something like:
http://www.woodmann.com/fravia/fragas1.htm[^]
[/EDIT]
...cmk
Save the whales - collect the whole set
-- modified at 23:27 Saturday 22nd April, 2006
|
|
|
|
|
The problem is that it is not documented as such. I got the answer from:
http://msdn.microsoft.com/msdnmag/issues/0203/loader/default.aspx
Look at the attached project files.
tried it, and it works! Just be sure to get the Name Decorations right.
LateNightsInNewry
|
|
|
|
|
For All those Reading:-
I got an Answer from Elsewhere
Microsoft has a Method for this:-
1. Start a New Project for MyNewApi.DLL
2. Create a Text File: MyNewApi.DEF
3. Make an Entry: LIBRARY=MyNewApi
4. Create a New Section: [EXPORT]
5. In the [EXPORT] section: write:
_MyFun=NTDLL.?Another@YKKKk@Z
LateNightsInNewry
|
|
|
|
|
|
Since you don't have Windows experience, definitely stay away from MFC - you need solid Win32 knowledge to use it well.
Honestly, that list is a pretty tall order for someone with no experience. I don't use .NET but I'm pretty sure the BCL has classes to do all of those items you listed. (well, #2 isn't a coding issue, it's just a matter of creating the right registry entries)
--Mike--
Visual C++ MVP
LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
Can you define what you mean by BCL? If it's part of .NET I cannot use it
I've got a BS in Computer Science, but they made us use Java I just finished building a an application for Windows, and it took me about a week and a half... and it works great, so I've got *some* experience with Windows and Visual C++ now.
By the way, which is easier to port to .NET, MFC or straight up Windows calls?
-- modified at 16:38 Saturday 22nd April, 2006
|
|
|
|
|
chasetoys wrote: Can you define what you mean by BCL?
It's the Base Class Library, which is part of .NET.
Kevin
|
|
|
|
|
Goes to Show, a BSC does no longer confer any knowledge onto the recipient.
I also assume that the 'They Made Us use Java' means that 'They' had secret agents and snipers out to shoot and kill on sight anyone found to take any interest in computer science, including browsing in second hand shops for books on CPP, Books written by Matt Pietreck, or, in general, taking any interest in how a computer works and achieves it's goals.
Become Real! If You're interested in computers, don't forget java, it has it's uses, and start to learn how the thing works!!!
LateNightsInNewry
|
|
|
|