|
Simply comparing to NULL seems to work fine.
__gc class ManagedClass
{
};
class UnmanagedClass
{
gcroot<ManagedClass *> m;
public:
UnmanagedClass() : m(new ManagedClass())
{}
virtual bool unmanagedFunction() const
{
if (m == NULL)
cout << "Hai";
return true;
}
};
BTW, you'd get better answers in the C++/CLI forum.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Hello everyone,
I have next problem : I have just installed Visual Studio 2005,without removing Visual Studion 2003.Net , then I opened a VS2003 C++ Project in VS2003 IDE , modified some code ad clicked Debug and got an error :
HugeIntDemo fatal error C1001: INTERNAL COMPILER ERROR
(compiler file 'Debug/HugeIntDemo.pch', line 1)
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more information
And in Release Build , with the latter error I get additionalyy this error :
HugeIntDemo fatal error C1060: compiler is out of heap spaceHugeIntDemo fatal error C1060: compiler is out of heap space
This happens with all VS2003 Projects, Can anybody help?
thanks
I have fixed the problem if anyone has the same problem than enter the Debug directory of the current project and delete all files inside...
"Success is the ability to go from one failure to another with no loss of enthusiasm." - W.Churchill
|
|
|
|
|
I have written dll pgm for ATM NIC card using socket pgm in c++
I am getting an error no 10055 (No buffer space available)when i have executed this pgm.
I tried all the solutions like editing the registry to increase the socket size which were mentioned in different sites, MSDN etc but still this error is existing.
So what should I do for this error.
One more thing i observed is that when i give the VPI value as 0 then it is showing as though some thing is getting transmitted but the VPI value other than zero then error 10055 is appearing.
|
|
|
|
|
This happens sometimes when the internet connection has (just) been dropped.
Did you check that?
SkyWalker
|
|
|
|
|
Train free @Microsoft
Got to this link and register free for
training your self for VS2005
https://www.microsoftelearning.com/visualstudio2005/
or
http://www.financialexpress.com/latest_full_story.php?content_id=107645
Microsoft dont give anything free except training
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
Thank you for the link!!
- Kyle
|
|
|
|
|
vikas amin wrote: Microsoft dont give anything free except training
It's Give many things.. but you have to find them
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Hi All
I am making a dilog based application where I need to enumerate registry keys and all its subkys,
I am able to enumerate all keys and subkeys,
Now the problem is that I want to diplay all the keys in tree form( by CTreeCtrl class) as in regedit.
I am using following code for enumerating keys and subkeys
Here all subkeys of "HKEY_CLASSES_ROOT" are enumerated.
<br />
<br />
LONG lResult;<br />
int iDepth = 0;<br />
CString cstrKeyRootName = _T("HKEY_CLASSES_ROOT");<br />
CString cstrKeyName = _T("");<br />
CString cstrFullPathStr;<br />
<br />
<br />
HKEY hCurKey, hPrevKey;<br />
HKEY hParentKey[100];<br />
DWORD dwParentIndex[100];<br />
TCHAR strCurString[1024], strPrevString[1024];<br />
TCHAR strParentString[1024][100];<br />
DWORD dwCurIndex = 0, dwPrevIndex = 0;<br />
HKEY hKeyRootName = HKEY_CLASSES_ROOT;<br />
<br />
lResult = RegOpenKeyEx(hKeyRootName, cstrKeyName, 0, KEY_ENUMERATE_SUB_KEYS, &hCurKey);<br />
<br />
if(cstrKeyName.IsEmpty())<br />
cstrFullPathStr = cstrKeyRootName;<br />
else<br />
cstrFullPathStr = cstrKeyRootName + _T("\\") + cstrKeyName;<br />
<br />
do<br />
{<br />
lResult = RegEnumKey(hCurKey, dwCurIndex, strCurString, sizeof(strCurString));<br />
<br />
hPrevKey = hCurKey;<br />
dwPrevIndex = dwCurIndex;<br />
_tcscpy(strPrevString, strCurString);<br />
<br />
if((lResult == ERROR_NO_MORE_ITEMS) || (lResult == ERROR_INVALID_HANDLE))<br />
{<br />
<br />
iDepth--;<br />
if(iDepth < 0)<br />
break;<br />
<br />
<br />
hCurKey = hParentKey[iDepth];<br />
dwCurIndex = dwParentIndex[iDepth] + 1;<br />
_tcscpy(strCurString, strParentString[iDepth]);<br />
<br />
int i = cstrFullPathStr.ReverseFind(_T('\\'));<br />
CString cstrTemp;<br />
cstrTemp = cstrFullPathStr.Left(i);<br />
cstrFullPathStr = cstrTemp;<br />
<br />
continue;<br />
}<br />
<br />
else<br />
{<br />
hParentKey[iDepth] = hCurKey;<br />
dwParentIndex[iDepth] = dwCurIndex;<br />
_tcscpy(strParentString[iDepth], strCurString);<br />
<br />
cstrFullPathStr += _T("\\");<br />
cstrFullPathStr += strCurString;<br />
<br />
lResult = RegOpenKeyEx(hCurKey, strCurString, 0, KEY_ENUMERATE_SUB_KEYS, &hCurKey);<br />
<br />
iDepth ++;<br />
dwCurIndex = 0;<br />
}<br />
<br />
}while(TRUE);<br />
<br />
Now I have been stucked that how to insert these keys into tree.
please tell the modification in the code for inserting keys into the tree.
Please reply.
Thanks
|
|
|
|
|
Try calling InsertKeyIntoTree(pTree, hCurKey);
(You'll have to write that function yourself, of course.)
The opinions expressed in this communication do not necessarily represent those of the author (especially if you find them impolite, discourteous or inflammatory).
|
|
|
|
|
Hi
I heve tried to achieve goal as follows:
<br />
<br />
do<br />
{<br />
lResult = RegEnumKey(hCurKey, dwCurIndex, strCurString, sizeof(strCurString));<br />
<br />
hPrevKey = hCurKey;<br />
dwPrevIndex = dwCurIndex;<br />
_tcscpy(strPrevString, strCurString);<br />
<br />
<br />
if((lResult == ERROR_NO_MORE_ITEMS) || (lResult == ERROR_INVALID_HANDLE))<br />
{<br />
<br />
iDepth--;<br />
if(iDepth < 0)<br />
break;<br />
<br />
continue;<br />
}<br />
<br />
else<br />
{<br />
<br />
hParentKey[iDepth] = hCurKey;<br />
dwParentIndex[iDepth] = dwCurIndex;<br />
_tcscpy(strParentString[iDepth], strCurString);<br />
InsertKeyIntoTree(htRootKey,strCurString,hCurKey);<br />
lResult = RegOpenKeyEx(hCurKey, strCurString, 0, KEY_ENUMERATE_SUB_KEYS, &hCurKey);<br />
<br />
iDepth ++;<br />
dwCurIndex = 0;<br />
}<br />
<br />
}while(TRUE);<br />
<br />
<br />
void COEPATHDlg::InsertKeyIntoTree(HTREEITEM htRootKey,CString strCurString,HKEY hCurKey)<br />
{<br />
m_RegistryTree.InsertItem(strCurString,NULL,NULL,htRootKey);<br />
<br />
}<br />
but it is printing again all the kyas at the same level.
Please suggest me.
Thanks
|
|
|
|
|
rajeevktripathi wrote: void COEPATHDlg::InsertKeyIntoTree(HTREEITEM htRootKey,CString strCurString,HKEY hCurKey)
{
m_RegistryTree.InsertItem(strCurString,NULL,NULL,htRootKey);
}
you forget to store the returning HTREEITEM handle in required variable
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Hi
Here I have been stucked in maintaining HTREEITEM for all the Registry keys because every time InsertKeyIntoTree( ) is called htRootKey is passed so each key is inserted at the same level
So please tell me that how can I maintain HTREEITEM for all the keys so that when I pass it to the InsertKeyIntoTree( ) it get place at the desired location in the hierarchy.
Please reply.
Thanks.
|
|
|
|
|
rajeevktripathi wrote: So please tell me that how can I maintain HTREEITEM for all the keys so that when I pass it to the InsertKeyIntoTree( ) it get place at the desired location in the hierarchy.
Here is small logic :-
1. Change Signature of the InsertKeyIntoTree function to return the HTREEITEM handle.
2. Now when you Insert the Parent, store the Keys into some Data structure
3. otherwise pass that key as Parent Paramter to then Tree Ctrl
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Dear members hi
Thanks for your advises, now I have been able to to generate the tree as desired.
Once again thanks
Bye
rajeevktripathi
|
|
|
|
|
I need to develope my app using Visual C++ and MFC
But then i have dificulties in learning its classes
any idea where i could obtain any reference from web which can help to know about MFC classes
|
|
|
|
|
|
|
TBBUTTON tbb;
memset(&tbb, 0, sizeof(tbb));
int iString = m_mytoolbar.GetToolBarCtrl().AddStrings(_T("About"));
tbb.iString = iString;
tbb.fsState = TBSTATE_ENABLED;
tbb.fsStyle = TBSTYLE_AUTOSIZE;
tbb.iBitmap = 0;
tbb.idCommand = ID_ABOUT;
tbb.dwData = 0;
VERIFY(m_mytoolbar.GetToolBarCtrl().AddButtons(1, &tbb));
I created a toolbar used TBBUTTONs.But I found that I can't get the button text.
I used GetString and GetButtonText. But the compiler said that they were all undeclared.
What's wrong?
Thank you!
|
|
|
|
|
strText = m_mytoolbar.GetButtonText(m_nButtonIndex);
I used GetButtonText,but the strText is always NULL.
|
|
|
|
|
Tcpip2005 wrote: I used GetButtonText,but the strText is always NULL.
Use
CToolBarCtrl::GetButtonInfo::GetButtonInfo( int nID, TBBUTTONINFO* bbi );
it's bbi pointer contain the Button text Information!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Take a look at the CToolBarCtrl Class Members[^] topic in the MSDN. The GetButton member returns information about buttons. It doesn't look like any of the members return the text assigned to a button directly. I have a feeling it's simpler to just remember the text you assign when you create the control.
Software Zen: delete this;
|
|
|
|
|
Hi to All,
How can I make my Exe as a service using VC++. that service should appear in Services of Administrator tools and that should start when the system is boot up and should appear in system tray icon to tell that it is started. Can anybody help in this regard.
Thanks in advance.
|
|
|
|
|
|
I have used DialogBar in my application on which i have few Dropdown listbox,
i dynamically create and destroy the DlgBar depending the option selected
by the user.
The problem is that the DlgBar is not visible when i creat it ,
i tried
AfxGetMainWnd()->RedrawWindow();
AfxGetMainWnd()->Invalidate (TRUE);
But it donot work .............
When i minimise and maximise the application then i can see the DlgBar
by using this code.
AfxGetMainWnd()->ShowWindow(SW_MINIMIZE);
AfxGetMainWnd()->ShowWindow(SW_MAXIMIZE);
Can anyone point out what i am missing .
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
I'll assume you mean a control bar.
You could try: CFrameWnd::ShowControlBar(CControlBar* pBar, BOOL bShow, BOOL bDelay);
INTP
Every thing is relative...
|
|
|
|