|
Nibu, You're the best
|
|
|
|
|
Try:
ListView_SetItemState(GetDlgItem(hwnd, ID_DATA_LIST), 0, LVIS_FOCUSED|LVIS_SELECTED, LVIS_FOCUSED|LVIS_SELECTED);
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Hehe, Thats what I would normaly do, but since it wasn't working as I wanted I decided to break it into two lines to attempt to determine what exactly was wrong :p
|
|
|
|
|
When you right click a CD/DVD-ROM, windows will show a menu, and one of its menuitem is just the "Eject"! I want to control the flow of eject action,when user click the menuitem, it will go into my codes.
I use the ModifyMenu function to modify the "eject" menuitem, but how could i know if the current menuitem is "eject",just as what i want? If use the MF_BYPOSITION flag, it is impossible to get the position of the "eject" menuitem. If use MF_COMMAND, after a long trace to code, i find the ID of "eject" menuitem can be case 31014://normal
case 30757://folder view
case 47://tree view while using folder mode
case 31078://short cut
case 102:// quick launch
case 38://tree view in the application of winrar
case 39://toolbar on taskbar
I have to use a switch statement to handle the condition.
I don't konw if the "eject" ID have other value, and if i find it, i have to modify my code, it boring me so much. Could someone help me to fix this trouble? All codes are place at function
HRESULT CXXXXXX::QueryContextMenu ( HMENU hmenu, UINT uMenuIndex,
UINT uidFirstCmd, UINT uidLastCmd, UINT uFlags ).
Thanks!
|
|
|
|
|
Hello!
Could anybody, plz tell me the list of third party controls available, which can be used in an MFC Application.
Is there any third party control like XmlEditView?
Thanx a lot
"If you change then change for the good."
|
|
|
|
|
This is what I know:
UltimateToolbox Here[^]
UltimateGrid Here[^]
Nibu thomas
Software Developer
|
|
|
|
|
Hello!
Thanx for replying. But, i dun wanna this type of controls.
I want a control like XMLEdit view. It should be more or less like the document area of xml Editor.
Thanx
"If you change then change for the good."
|
|
|
|
|
|
I had an simple object by using ATL Object wizard and a generic class CTCPSocket.
The com object name is CTest and interface is ITest. This class had a interface Add and a connection point Fire_notify.
And CSocket had two methods add_in and notify.
The code as following:
//CTest class
CTest:Add(long port)
{
CTCPSocket sk;
sk.add_in(port);
}
CTest:OnNotify()
{
Fire_notify();
}
//CTCPSocket class
CTCPSocket:add_in(long port)
{
//create a socket and listening
}
CTCPSocket:notify()
{
//created a tcp connectiong?
//when created a socket accept,pass the event to CTest:OnNotify()
}
when the client call the CTest->Add method, CTCPSocket will create a socket and listening, but the problem is: when there is a tcp connection event,how to pass the event to CTest:OnNotify() from CTCPSocket:notify()?
Thanks
Brygid
www.ecq.name
|
|
|
|
|
Hi,
I want to concatenate a variable of type 'unsigned long' to a variable of type 'char []'. How can this be done, since strcat() function takes 'char' arguments?
Thanks.
-Kranti
|
|
|
|
|
This is how we do it:
<font color=blue>#include</font> <iostream>
<font color=blue>#include</font> <sstream>
<font color=blue>int</font> main( )
{
<font color=blue>using namespace</font> std;
<font color=blue>long</font> lng = 2000;
stringstream strs;
strs<<"hello: "<<lng;
cout<<strs.str();
}
Nibu thomas
Software Developer
|
|
|
|
|
You can use sprintf().
check here ... [^]
Vini
|
|
|
|
|
Assuming that you by char[] really mean std::string (because you're a conscious[1] developer that avoids bald arrays and pointers if possible, right? ), then do like this:
std::string ToString(unsigned long value)
{
char buffer[33];
return std::string(_ultoa(value, buffer, 10));
}
std::string concatenated(original.append(ToString(value)));
[1] Conscientious?
--
The Blog: Bits and Pieces
-- modified at 5:09 Monday 27th February, 2006
|
|
|
|
|
Johann Gerell wrote: Assuming that you by char[] really mean std::string
You assume too much. That wasn't what he asked at all.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Ryan Binns wrote: You assume too much.
That assumption was more of a veiled desire.
I could have replied: "If you're using char[] instead of std::string , then I'll be more than willing to answer your question if you restate it using a std::string instead."
But that would've been a bit too pompous, wouldn't it?
So, I stuck in my (maybe too disguised) point as I saw fit.
Ryan Binns wrote: That wasn't what he asked at all
Since when is there a one-to-one relationship between what one asks and what one means?
--
The Blog: Bits and Pieces
|
|
|
|
|
Johann Gerell wrote: That assumption was more of a veiled desire.
You're still assuming too much about his problem. Is he actually writing C++, or maintaining (or even writing) an ANSI C program? He hasn't told us. Your solution, while excellent for C++, is not very useful for a C program.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Johann Gerell wrote: because you're a conscious developer
Well, I certainly hope he's conscious when he codes. Quite a feat to code while unconscious (although looking at some code makes one wonder ). Or did you mean conscientious?
You may be right
I may be crazy
But it just may be a lunatic you’re looking for
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
PJ Arends wrote: Or did you mean conscientious?
Check! (The reply is now somewhat updated... )
--
The Blog: Bits and Pieces
|
|
|
|
|
Here's one way:
char szBuff[5] = {0};
_ultoa(1234, szBuff, 10);
char szTemp[32];
strcpy(szTemp, "The number is ");
strcat(szTemp, szBuff);
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Hi guys
I'm porting some VC6 code to Visual Studio 2005. When I compile, I'm getting the following errors:
combase.h(253): error C2373: 'InterlockedExchange' : redefinition; different type modifiers
combase.h(253): error C2491: 'InterlockedExchange' : definition of dllimport function not allowed
combase.h(253): error C3861: 'InterlockedExchange': identifier not found, even with argument-dependent lookup
C++ being a secondary language for me, I'm having trouble figuring this out. Previously this code compiled fine under VC6, yet I get these compiler errors under VS7 and VS8.
Combase.h is a DirectShow base definition header, it appears...
Any thoughts at all would be appreciated.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Connor's Christmas Spectacular!
Judah Himango
-- modified at 23:54 Sunday 26th February, 2006
|
|
|
|
|
|
Thanks, I should've tried that before posting, but didn't want to mess with the existing source too heavily. I'll give that a try. Thanks again.
|
|
|
|
|
Hi All
I am having a problem, will explain with the help of example
Let an dialog based MFC Application for performing some arithmetic operations, now I want to make a startup disk for this application so that if system is switched on or reboot with this disk then instead of windows this application shoul load and run, and after exit of this application Windows OS should be loaded as usual.
I think problem would be clear.( if not then please ask I would try to make it more clear)
Please help me.
Thanks
|
|
|
|
|
You can't run a dialog-based application without Windows. What you're asking can only be done with a generic DOS application that doesn't use Windows at all.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Thanks
OK then I will make a DOS based application and then pls suggest me to create startup disk for that application and how to load that apllication on booting and when exit from application system work as usually.
|
|
|
|