|
I Developed a Tree Control using Microsoft Tree Control API
in Win32 SDK. When i adding more nodes or items to the Tree Control i am getting memory problem, how can i avoid this problem ?
Any help...
thank you
|
|
|
|
|
how to creat service in vc++?
r00d0034@yahoo.com
|
|
|
|
|
|
|
Here[^] you can download an AppWizard for VC6.
Pavel
Sonork 100.15206
|
|
|
|
|
Hello there,
I used to below function to add string to RichEdit box, it works fine on Win98 or WinXP ... but it has bug in Win2000 !
Function:
void CResultDialog::AddText(CString str, COLORREF rgb, BOOL bold, BOOL italic, BOOL underline)
{
// get current length from rich text box ...
int nCurLen = m_Rich.GetTextLength();
// hide selected text !
m_Rich.HideSelection(TRUE, FALSE);
// move the cursor to end of rich control ...
m_Rich.SetSel(nCurLen, nCurLen);
// attach the new string to the last of rich edit ...
m_Rich.ReplaceSel(str);
int nStartPos = nCurLen;
int nEndPos = m_Rich.GetTextLength();
// configure the character format !
CHARFORMAT2 cf;
cf.cbSize = sizeof(CHARFORMAT2);
cf.dwMask = CFM_COLOR | CFM_BOLD | CFM_UNDERLINE | CFM_ITALIC;
cf.dwEffects = (unsigned long)~(CFE_ITALIC | CFE_UNDERLINE | CFE_BOLD | CFE_AUTOCOLOR);
cf.crTextColor = rgb;
cf.dwEffects |= underline ? CFE_UNDERLINE : cf.dwEffects;
cf.dwEffects |= bold ? CFE_BOLD : cf.dwEffects;
cf.dwEffects |= italic ? CFE_ITALIC : cf.dwEffects;
// select added text ...
m_Rich.SetSel(nStartPos, nEndPos);
// use character format !
m_Rich.SetSelectionCharFormat(cf);
m_Rich.SetSel(-1, -1);
}
I used this function in here:
AddText( "Company: ", RGB(255, 0, 0), TRUE, FALSE, FALSE );
AddText( "Microsoft", RGB(0, 0, 0), TRUE, FALSE, FALSE );
AddText( "\nContact: ", RGB(255, 0, 0), TRUE, FALSE, FALSE );
AddText( "Billi", RGB(0, 0, 0), TRUE, FALSE, FALSE );
AddText( "\nWeb: ", RGB(255, 0, 0), TRUE, FALSE, FALSE );
AddText( "www.m$.com", RGB(0, 0, 0), TRUE, FALSE, FALSE );
It has bug in Win2000,
The bug is colors on the text ...
I think it's because my enter character in my strings ...
Win98 or WinXP count enter character in for getting lenght but Win2000 doesn't it, or vice versa !
How can i solve it ??
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Tried \r\n (which is the normal return on Windows) ?
MS quote (http://www.microsoft.com/ddk) : As of September 30, 2002, the Microsoft® Windows® 2000 DDK, the Microsoft Windows 98 DDK, and the Microsoft Windows NT® 4.0 DDK will no longer be available for purchase or download on this site.
|
|
|
|
|
Hello there,
I made a MFC project by VC++ .NET and i choose Farsi language for one of my dialogs in my project ...
I put a button in the farsi dialog ...
I wrote farsi string in button and when i run it i see ASCII characters insted my farsi string !!!
What's wrong ??????
How can i solve it ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
I have the same problem ,
Is it a vc.net's bug ? or i use it wrong ?
|
|
|
|
|
Hi,
I am using VC6.0++ with DAO & MS Access97! So far I use SQL successfully ... well except 2 thing:
*) With this: strSQL.Format ("SELECT * FROM Sample WHERE Title != 'Date'"); I can search the whole Sample table at column "Title" for string "Date"!
1) Let say to do the same, how can I search ... but at any cell has some thing (not empty string, or not empty field)?
2) In the table there is a column with define as COleDateTime, how can I search the same above technique for a equivalent COleDateTime day:
ie: Search for cell has "12/31/2001" in the column "Date"
I appreciate any help help here
Many thanks,
Anh
|
|
|
|
|
1) I think that SELECT * FROM Sample WHERE title <> '' AND title IS NOT NULL (I'm not sure if title IS NOT NULL is necessary).
2) SELECT * FROM Sample WHERE Date = '2001-31-12' should do the trick. Beware if the time is included you may have to issue SELECT * FROM Sample WHERE Date >= '2001-31-12' AND Date < '2001-31-12' .
Try those.
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
Hi Michel,
Thank you very much for request #1, it works beautifully! However, the suggestion for #2, I tried and failed! Did you try it successfully, or might be I missing some thing?
Many thanks,
Thanh
|
|
|
|
|
I don't know MS Acces at all, but I know that for the SQL server to understand your date format, you must know the locale it uses.
For instance, in en-US (0x409 or 1033), '12/31/2001' (try that), in fr-CA (0xC0C or 3084), '31/12/2001', etc...
Somebody once suggested the format I put in #2 to be locale-independant, but it doesn't seem to work in Access. Try the '12/31/2001' and see what happens.
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
newbie beware!
okay, i create a button
HWND myhwnd;
myhwnd = CreateWindowEx(WS_EX_STATICEDGE,"Button","About",WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON,10,10,25,15,parent,(HMENU)ID,hInst,0);
the font is bold by default, how can i set the font.
Any good reading here, really appreciated, as always, any helps appreciated also.
shotgun
|
|
|
|
|
|
If I install VS.NET will it interfer with previous installation of visual c++ 6.0???
|
|
|
|
|
Nope, I have them happily co-existing on my machine and from what I've seen most other people have had no problems either. Just as well, people are just too damned comfortable in VC6
--
Paul
"I need the secure packaging of Jockeys. My boys need a house!"
- Kramer, in "The Chinese Woman" episode of Seinfeld
MS Messenger: paul@oobaloo.co.uk
Sonork: 100.22446
|
|
|
|
|
Apparently, during installation, you have to give the common directory a different name so it is not the same as the VC6 one but I accidentally did this and have experienced no problems so far.
Must admit since getting VS.NET, 90% of my time is spent on VC6. It's not that much better to warrant the change at the moment unless you specifically need the .NET features.
Adam.
www.beachwizard.com/travelogue[^]
"I spent a lot of my money on booze, birds and fast cars. The rest I just squandered"
George Best.
|
|
|
|
|
Iv'e declared:
<font color=blue>class MyClass</font><br />
{<br />
<font color=blue>typedef void</font> (<font color=blue>MyClass</font>::* MyClassMethodPtr)();<br />
<br />
<font color=blue>MyClass</font>()<br />
{<br />
m_pMethod = voidMethod; <font color=green>
m_pMethod(); <font color=green>
}<br />
<br />
MyClassMethodPtr m_pMethod;<br />
<font color=blue>void</font> voidMethod()<br />
{<br />
<font color=green>
}<br />
};
Why??? Howto create useable pointer-to-classMembFunc???
--BlackSmith--
/*The roof is on fire, we don't need no water, let the MF burn*/. BHG.
|
|
|
|
|
BlackSmith wrote:
Howto create useable pointer-to-classMembFunc???
in general, you can't use non-static member functions via a function pointer.
it works fine, tho, if you rewrite the code like so:
class MyClass
{
typedef void (* MyClassMethodPtr)();
MyClass()
{
m_pMethod = voidMethod;
m_pMethod();
}
MyClassMethodPtr m_pMethod;
static void voidMethod()
{
}
};
-c
As always, it's bread and circuses. And while bread is down right now, circuses are way up.
|
|
|
|
|
The questioner was asking about a member function pointer.
You can not use a static member function with a member function pointer.
You can however, use a function pointer with a static member function.
Function pointers and member function pointers are two different things, and you can't mix them.
|
|
|
|
|
(m_Obj.*m_Func)()
Try the following:
MyClass()
{
m_pMethod = voidMethod; //OK
(*m_pMethod)();
}
To use function pointers you have to use some funcky looking syntax.
If you're calling the function from inside your class, just prefix the pointer with an asterick, and wrap perantesise around it:
(*MyFunPtr_Array)();
If you're doing it out side of the class, you would use the following syntax:
(MyClassVar.*m_Func)();
|
|
|
|
|
Axter wrote:
Try the following:
MyClass()<br />
{<br />
m_pMethod = voidMethod;
(*m_pMethod)(); <font color=red>
Error1: error C2171: '*' : illegal on operands of type 'void (__thiscall MyClass::*)(void)'<br />
Error2: error C2064: term does not evaluate to a function<br />
</font>}
Whattodo?????
--BlackSmith--
/*The roof is on fire, we don't need no water, let the MF burn*/. BHG.
|
|
|
|
|
I tested the proposed solution I gave you on VC++, and for some reason it doesn't like the syntax without the class prefix.
If you're using VC++, try the following instead:
class MyClass
{
public:
typedef void (MyClass::* MyClassMethodPtr)();
MyClassMethodPtr m_pMethod;
MyClass()
{
m_pMethod = voidMethod; //OK
((*this).*m_pMethod)();
}
void voidMethod()
{
//Do do do, boo boo boo...
printf("Hello World");
}
};
|
|
|
|
|
Thanks man, this works (For real?! for sure!)
--BlackSmith--
/*The roof is on fire, we don't need no water, let the MF burn*/. BHG.
|
|
|
|
|