|
It's not really a VS.NET extension coz i've used #pragma once in VC++ 6 also. Though not sure if it was present in earlier versions too or not.
And you will know my name is the Lord when I lay my vengeance upon thee.
|
|
|
|
|
Hi ,
Really thanx a lot for the help !!!
bk
|
|
|
|
|
Oh yeah, i forgot to mention that the define at the top of each header file should be unique for each header file.
I usually use this pattern:
If the file is called file.h, the define symbol becomes __FILE_H__
So, if I had Employee.h, I'd define the symbol as __EMPLOYEE_H__
--
Shine, enlighten me - shine
Shine, awaken me - shine
Shine for all your suffering - shine
|
|
|
|
|
check their copy of windows.h and let me know if it has these lines maybe 20 lines from the start?
#if(WINVER >= 0x0500)
#pragma message ("")
#pragma message ("NOTE: WINVER has been defined as 0x0500 or greater which enables")
#pragma message ("Windows NT 5.0 and Windows 98 features. When these headers were released,")
#pragma message ("Windows NT 5.0 beta 1 and Windows 98 beta 2.1 were the current versions.")
#pragma message ("")
#pragma message ("For this release when WINVER is defined as 0x0500 or greater, you can only")
#pragma message ("build beta or test applications. To build a retail application,")
#pragma message ("set WINVER to 0x0400 or visit http://www.microsoft.com/msdn/sdk")
#pragma message ("to see if retail Windows NT 5.0 or Windows 98 headers are available.")
#pragma message ("")
#pragma message ("See the SDK release notes for more information.")
#pragma message ("")
#endif
I found them lurking in my copy of windows.h but when I went to the PSDK site at Microsoft to update it tells me I already have the latest version installed.
Rob Manderson
http://www.mindprobes.net
|
|
|
|
|
That shows you how OLD VC 6 is. "Windows NT 5.0" is what we now call Win 2000. You should be using the PlatSDK include & lib dirs instead of the ones that shipped with VC, so you'll never see that message. Assuming you have a recent PSDK, you can click on Visual Studio Registation->Register PSDK Directories with Visual Studio in the PSDK program group to put the dirs in VC's search path.
--Mike--
THERE IS NO THERE IS NO BUT THERE IS
MAGIC PIXIE DUST BUSINESS GENIE CODE PROJECT
Homepage | RightClick-Encrypt | 1ClickPicGrabber
"You have Erica on the brain" - Jon Sagara to me
|
|
|
|
|
Aha!!!! Now I know why some constants weren't defined! I've installed the platform SDK within the last three months (when I arrived in the US and put my new machine together) but I never thought to update the search paths in Visual Studio... Doh!!!
Thanks Mike
Rob Manderson
http://www.mindprobes.net
|
|
|
|
|
hello I need help ,I want to disable key 'print screen' and 'Ctrl+C' and 'Ctrl+V' in MFC(use CRichEditCtrl) but I don't know how to do,Please help
thank you.
i am a student in thailand
|
|
|
|
|
I need a class of some sort that takes an equation like 12391+19-334+x^2=d^4*123 or somthing and it must find when the values of x and d or more values multiple values are correct but it must accept a string type? As in the equation will be located within a string. DDoes anyone know where I can find a program that does this? Exactly?
|
|
|
|
|
Mathcad? Maple?
--
Shine, enlighten me - shine
Shine, awaken me - shine
Shine for all your suffering - shine
|
|
|
|
|
Hi,
is it safe to call KillTimer() inside a TimerProc? MSDN does not mention it's bad for a timer proc to stop it's timer, just want to make sure I'm not doing something evil...
Thanks, Moak
|
|
|
|
|
|
thanks
|
|
|
|
|
Is it possible to have SHFileOperation automatically create new folders when copying files? For instance: "d:\testfile.txt" to "d:\somefolderthatdoesn'tcurrentlyexist\testfile.txt". If it doesn't do that, is there an easy way to get around that limitation, without having to do some complex string parsing to find and make new folders?
|
|
|
|
|
I'll be posting my FileSystem article soon. It provides this and other convenient functions. Meanwhile, here's the logic:
long FileSystem::createDir
(CString strDirectory)
{
if (dirExists (strDirectory))
return (Status::Duplicate);
CString strDirParent;
getParentDir (strDirectory, strDirParent);
if (!strDirParent.IsEmpty() && !dirExists (strDirParent))
{
long nStatus = createDir (strDirParent);
if (nStatus == FileSystem::Status::Error)
return (nStatus);
}
DWORD dwStatus = ::CreateDirectory (strDirectory, NULL);
if (dwStatus == 0)
return (Status::Error);
return (Status::Success);
} /ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Anyone know how to create those bubble-style tool tips? standard tool tips derived from CToolTipCtrl are such a boaring rectangle.
|
|
|
|
|
Mel wrote:
Anyone know how to create those bubble-style tool tips? standard tool tips derived from CToolTipCtrl are such a boaring rectangle.
Have you looked here on CP?
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
Yes, but I just now found something that will probably work: "Balloon Help as a non-modal replacement for MessageBox() By Shog9"
|
|
|
|
|
You must add the TTS_BALLOON style to your CToolTipCtrl object.
m_pToolTip.Create(this, TTS_BALLOON);
May be you need to define this style
#ifndef TTS_BALLOON
#define TTS_BALLOON 64
#endif
Or you can look my class CPPTooltip
Best regards,
Eugene Pustovoyt
|
|
|
|
|
Thanks for your suggestion --exactly what I wanted.
|
|
|
|
|
Hi,
I'm working on a SDK for a program I have done and I have problem using the static library I provide with VC6. The library is build using VC7. So far my searches has been unsuccesful. Has anyone else found solution for this?
When I was migrating from VC5 to VC6 I remember there was a compiler switch to make VC5 compatible static libraries. I dont remember wich one it was though.
I made a test lib, and tried to use it with VC6 and I got for example following errors in the linker:
debug build:
corelibd.lib(Vector3C.obj) : error LNK2001: unresolved external symbol __RTC_CheckEsp
corelibd.lib(ControllerC.obj) : error LNK2001: unresolved external symbol __RTC_Shutdown
corelibd.lib(TimeSegmentC.obj) : error LNK2001: unresolved external symbol __RTC_InitBase
corelibd.lib(TimeSegmentC.obj) : error LNK2001: unresolved external symbol @_RTC_CheckStackVars@8
in both debug and release:
corelibd.lib(ParamI.obj) : error LNK2001: unresolved external symbol __ftol2
corelibd.lib(KeyC.obj) : error LNK2001: unresolved external symbol "void __cdecl operator delete[](void *)" (??_V@YAXPAX@Z)
corelibd.lib(KeyC.obj) : error LNK2001: unresolved external symbol "void * __cdecl operator new[](unsigned int)" (??_U@YAPAXI@Z)
For me it looks like the standard library is different in VC7. Any ideas how to overcome this?
|
|
|
|
|
I have written a small program that inserts items into an array and then uses the array to create a tree, problem is i don't know how to relate the tree to the array once it has been created.
ie.
a tree with 3 Name items, relates to an array with 3 name and address items.
I want to be able to click on the 2nd name and return the 2nd address.
If anyone could help with the function call to get an integer value for the selected item it would be great, or some casting work around.
Thanks in advance
|
|
|
|
|
The CTreeCtrl provides a DWORD value associated with each tree item. You can set this value with whatever you want and retreive this value later using the functions:
BOOL CTreeCtrl::SetItemData(HTREEITEM hItem, DWORD_PTR dwData)
and
DWORD_PTR CTreeCtrl::GetItemData(HTREEITEM hItem).
In your case you should set the item's data with its corresponding array index. You may even store in the item's data the address of the object held by the CObArray directly.
|
|
|
|
|
thanks,
not sure how to implement that in the code i've got to be honest..
Basically the important line i have is:
m_tTreeCtrl.InsertItem((versionPtr->GetVersionLabel());
Would it be wise after each insert to get the tree height, return that h treeinfo, then update it?
Also, is there a way to cast a DWord to an int? DWords are far too accurate for what i need.
Cheers
|
|
|
|
|
Pardon me, I cannot undestand this line of code (do not know what is the type of versionPtr ).
To demonstrate, I will assume that versionPtr is an object of type CMyObject and the member function GetVersionLabel() returns a string of that object contents. And finally that we have a CObArray named objArr containing objects of type CMyObject .
Using this assumption, this is how to link the tree items to the array:
int arrIndex;
.
.
CMyObject * pMyObj = (CMyObject *)objArr.GetAt(arrIndex);
HTREEITEM hItem = m_tTreeCtrl.InsertItem(pMyObj->GetVersionLabel());
m_tTreeCtrl.SetItemData(hItem, (DWORD)arrIndex);
.
.
CMyObject * pMyObj;
int index = (int)m_tTreeCtrl.SetItemData(hItem);
pMyObj = (CMyObject *)objArr.GetAt(index);
This sample store the index of the object in the array, a better approach is to store the address of the object itself. In this case, the item data set line would be:
m_tTreeCtrl.SetItemData(hItem, (DWORD)pMyObj);
and the item data retreival line would be:
pMyObj = (CMyObject *)objArr.m_tTreeCtrl.SetItemData(hItem);
I hope that is what you want.
|
|
|
|
|
Thanks very much for your time - i will try to implement it in the morning.
cheers
|
|
|
|