|
I downloaded the dotnetfx.exe and installed it on the other PC but still get an Assertion Error on Line 410 of occmgr.cpp.
I think I built a 'Release' version of the program, as it reported during the duilt process that the .Net framework is required on the target machine.
What now!?!
|
|
|
|
|
P.S., if you still get an "Assert" error, that means you are still running the Debug version!
"Fish and guests stink in three days." - Benjamin Franlkin
|
|
|
|
|
What do you need to do to build a Release Version?
I am struggling here!
|
|
|
|
|
There is a combo box near the menus that probably says "Debug". You should just be able to change this to "Release", and rebuild all, and it will work. Notice that the release build usually goes in a different directory, e.g.:
C:\Your Project\Release\YourProgram.exe
.. as opposed to the Debug, which goes in (unless you've changed it), something like:
C:\Your Project\Debug\YourProgram.exe
You'll notice the Release executable is about half the size as the Debug one.
"Fish and guests stink in three days." - Benjamin Franlkin
|
|
|
|
|
Um.. if this is an MFC program, you should NOT need the .NET framework! That is only if you are using C#, managed C++, etc.
You can use the Dependency Walker to see what DLLs your code depends on. Perhaps there is something you are missing. (If your VS.NET didn't install it, you can do a quick Google search and find it.)
When you build in Release mode, what is causing you to believe that you need the .NET Framework? Is some error popping up somewhere?
"Fish and guests stink in three days." - Benjamin Franlkin
|
|
|
|
|
I have now built a 'Release' version and no longer get the message that the .Net Framework is required.
I have installed the 'Release' version and after coping over some DLLs that were missing, when you double click on the icon nothing happens, no errors and apart from a 1/2 second the mouse changes shape to egg timer and back again.
They must be a simple answer to this problem, I am not doing anything unusual.
|
|
|
|
|
I am trying to get the list of domains AND LIST OF COMPUTERS under each domain.
I am getting domains when I use the parameter RESOURCE_GLOBALNET in WNetOpenEnum.
I am getting list of only computers when I use the parameter RESOURCE_CONTEXT in WNetOpenEnum.
But my requirement is I would like to get computers under each domain.
How should I achive this .This is the code.Pls tell me where I am going wrong.
NETRESOURCE res[10];
HANDLE hMain;
int x,y,i;
DWORD dwCnt = 0xffffffff;
DWORD dwSize;
DWORD dwRes;
dwRes = WNetOpenEnum (RESOURCE_GLOBALNET, RESOURCETYPE_ANY, 0,
NULL, &hMain);
dwSize = sizeof (res);
if (WNetEnumResource (hMain, &dwCnt, res, &dwSize) == NO_ERROR)
{
HANDLE hEnum;
dwRes = WNetOpenEnum (RESOURCE_GLOBALNET, RESOURCETYPE_ANY, 0, res,&hEnum);
while (dwRes == NO_ERROR || dwRes == ERROR_MORE_DATA)
{
dwCnt = 9;
dwSize = sizeof (NETRESOURCE) * 10;
dwRes = WNetEnumResource (hEnum, &dwCnt, res, &dwSize);
if (dwRes != ERROR_NO_MORE_ITEMS)
{
for ( i = 0; i < dwCnt; i++)
{
if (res[i].lpLocalName != NULL || res[i].lpRemoteName!= NULL)
{
//MessageBox(0,res[i].lpLocalName,res[i].lpRemoteName,0);
//Add this in to a list box. SendMessage (hwndList, LB_ADDSTRING, 0, (LPARAM)res[i].lpRemoteName) ;
}
}
}
WNetCloseEnum (hEnum);
}
WNetCloseEnum (hMain);
Pls guide
|
|
|
|
|
This works fine for me:
bool GetResources( NETRESOURCE *pNetResource )
{
DWORD dwResult;
NETRESOURCE *NetResource = NULL;
HANDLE hEnum;
dwResult = WNetOpenEnum(RESOURCE_GLOBALNET, RESOURCETYPE_ANY, 0, pNetResource, &hEnum);
if (NO_ERROR == dwResult)
{
NETRESOURCE Buffer[750];
DWORD Count = 0xFFFFFFFF,
BufferSize;
BufferSize = sizeof(Buffer);
do
{
dwResult = WNetEnumResource(hEnum, &Count, &Buffer, &BufferSize);
if (NO_ERROR == dwResult || ERROR_MORE_DATA == dwResult)
{
for (UINT i = 0; i < Count; i++)
{
if (Buffer[i].dwDisplayType == RESOURCEDISPLAYTYPE_DOMAIN)
cout << "Domain ";
else if (Buffer[i].dwDisplayType == RESOURCEDISPLAYTYPE_SERVER)
cout << "Server ";
else if (Buffer[i].dwDisplayType == RESOURCEDISPLAYTYPE_SHARE)
cout << "Share ";
else if (Buffer[i].dwDisplayType == RESOURCEDISPLAYTYPE_GROUP)
cout << "Group ";
else if (Buffer[i].dwDisplayType == RESOURCEDISPLAYTYPE_NETWORK)
cout << "Network ";
else if (Buffer[i].dwDisplayType == RESOURCEDISPLAYTYPE_ROOT)
cout << "Root ";
else if (Buffer[i].dwDisplayType == RESOURCEDISPLAYTYPE_SHAREADMIN)
cout << "ShareAdmin ";
else if (Buffer[i].dwDisplayType == RESOURCEDISPLAYTYPE_TREE)
cout << "Tree ";
else if (Buffer[i].dwDisplayType == RESOURCEDISPLAYTYPE_NDSCONTAINER)
cout << "NDS ";
else
cout << "Unknown ";
cout << Buffer[i].lpRemoteName << endl;
if ((Buffer[i].dwUsage & RESOURCEUSAGE_CONTAINER) == RESOURCEUSAGE_CONTAINER)
GetResources(&Buffer[i]);
}
}
} while (NO_ERROR == dwResult || ERROR_MORE_DATA == dwResult);
dwResult = WNetCloseEnum(hEnum);
}
return true;
}
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I am trying to get the list of domains AND LIST OF COMPUTERS under each domain.
I am getting domains when I use the parameter RESOURCE_GLOBALNET in WNetOpenEnum.
I am getting list of only computers when I use the parameter RESOURCE_CONTEXT in WNetOpenEnum.
But my requirement is I would like to get computers under each domain.
How should I achive this .This is the code.Pls tell me where I am going wrong.
NETRESOURCE res[10];
HANDLE hMain;
int x,y,i;
DWORD dwCnt = 0xffffffff;
DWORD dwSize;
DWORD dwRes;
dwRes = WNetOpenEnum (RESOURCE_GLOBALNET, RESOURCETYPE_ANY, 0,
NULL, &hMain);
dwSize = sizeof (res);
if (WNetEnumResource (hMain, &dwCnt, res, &dwSize) == NO_ERROR)
{
HANDLE hEnum;
dwRes = WNetOpenEnum (RESOURCE_GLOBALNET, RESOURCETYPE_ANY, 0, res,&hEnum);
while (dwRes == NO_ERROR || dwRes == ERROR_MORE_DATA)
{
dwCnt = 9;
dwSize = sizeof (NETRESOURCE) * 10;
dwRes = WNetEnumResource (hEnum, &dwCnt, res, &dwSize);
if (dwRes != ERROR_NO_MORE_ITEMS)
{
for ( i = 0; i < dwCnt; i++)
{
if (res[i].lpLocalName != NULL || res[i].lpRemoteName!= NULL)
{
//MessageBox(0,res[i].lpLocalName,res[i].lpRemoteName,0);
//Add this in to a list box. SendMessage (hwndList, LB_ADDSTRING, 0, (LPARAM)res[i].lpRemoteName) ;
}
}
}
WNetCloseEnum (hEnum);
}
WNetCloseEnum (hMain);
Pls guide
|
|
|
|
|
I have a base class that I have a copy construtor for, since I have dynamically allocated memory etc.
If I add a CList to my base class definition, and add the copying code to my base class copy constructor, do I need to also do the copying in my derived class??
class Msg
{ char *pszTst;
CList myList;
}
class tstMsg : public msg
{ }
msg::msg (const Msg &i_MsgToCopyFrom)
{
POSITION pos;
CIVAttrib attr, *pAttr;
if (i_MsgToCopyFrom.mCleanMsgBuffer != NULL)
{
mCleanMsgBuffer = new BYTE [i_MsgToCopyFrom.mCleanMsgBuffSize];
if (mCleanMsgBuffer != NULL)
memcpy (mCleanMsgBuffer, i_MsgToCopyFrom.mCleanMsgBuffer, i_MsgToCopyFrom.mCleanMsgBuffSize);
}
else
mCleanMsgBuffer = NULL;
pos = i_MsgToCopyFrom.myList.GetHeadPosition();
for (int i=0;i < i_MsgToCopyFrom.myList.GetCount();i++)
{
attr = myList.GetNext(pos);
pAttr = new CIVAttrib;
if (pAttr != NULL)
{
*pAttr = attr;
myList.AddTail(pAttr);
}
}
}
when i have a function call foo (tstMsg i_msg), will the copy constructor defined in the base class be called as well as the copy constructor of the derired class??
Thanks.
-C
|
|
|
|
|
no, it can't, how would it know how to initialise the object from the derived class ?
you must provide in the derived class a new copy constructor.
TOXCCT >>> GEII power
|
|
|
|
|
No.. i meant if i made a call foo (tstMsg i_msg), would this call both the derived and the base class copy constructors??
|
|
|
|
|
you could define such constructor (see my following post to understand where these types come from) :
Manager::Manager(<font style="color:blue;">const</font> string& n, <font style="color:blue;">int</font> d, <font style="color:blue;">int</font> lvl)
: Employee(n, d), <font style="color:green;">
level(lvl) <font style="color:green;">
{
<font style="color:green;">
}
TOXCCT >>> GEII power
|
|
|
|
|
i quote you the related chapter from the "C++ Language" (chapter §12.2.3). for that, we consider we have the following classes :
<font style="color:blue;">class</font> Employee {
string first_name, family_name;
<font style="color:blue;">short </font>department;
<font style="color:green;">
<font style="color:blue;">public</font>:
Employee(<font style="color:blue;">const</font> string& n, <font style="color:blue;">int </font>d); <font style="color:green;">
<font style="color:green;">
};
<font style="color:blue;">class</font> Manager : <font style="color:blue;">public</font> Employee {
set<Employee*> group;
<font style="color:blue;">short </font>level;
<font style="color:green;">
<font style="color:blue;">public</font>:
Manager(<font style="color:blue;">const </font>string& n, <font style="color:blue;">int </font>d, <font style="color:blue;">int </font>lvl);
<font style="color:green;">
};
"the copy:
Classes objects copy is defined by the copy constructor and also by the affectations. Watch the following code :
<font style="color:blue;">void</font> f(<font style="color:blue;">const</font> Manager& m) {
Employee e = m; <font style="color:green;">
e = m; <font style="color:green;">
}
Only the Employee of Manager is copied, because the copy functions of Employee don't know anything from Manager. That is commonly called slicing. That can be a source of surprises and mistakes. One of the reasons we transmit pointers to and references of objects into a hierarchy is precisely to avoid that operations. Polymorphic behavior safeguarding and efficiency improvement are other ones".
hope this will help...
TOXCCT >>> GEII power
|
|
|
|
|
So its not possible?? or do I need to do something else explicit within my copy constructor in my derived class?? How do I explicitly call the base class copy constructor when the derived copy constructor is called??
Maybe I"m not getting it.
-C
|
|
|
|
|
Correct. You need to explicitly copy the base class in the copied object's derived class. The base class default constructor is called before the derived class copy constructor.
In summation, a call to the derived class copy constructor does not call the base class copy constructor. Instead, the default constructor is called in the base class.
Kuphryn
|
|
|
|
|
Wheatbread wrote:
How do I explicitly call the base class copy constructor when the derived copy constructor is called??
like this... (see upper this post)
TOXCCT >>> GEII power
|
|
|
|
|
Thanks alot man!! Something so simple just seemed to confuse me!!
-C
|
|
|
|
|
Hi, I'm using MS VC++ 6.0. I have a dialog box with 255 edit boxes, so I had to add them dynamically in the code since the editor can only handle 255 controls total. Now I have to assign them ID's so I can use UpdateData and the Message map. I gave them ID's 200-455 because that didn't conflict with anything that'd been done automatically in Resource.h. That worked fine for the Message map, but when I tried to put it in DoDataExchange it violated the assertion: no data exchange control with ID 0x%04. Does this mean that I've chosen invalid numbers to use? The numbers generated in recourse.h seem to follow a pattern, but I can't figure out what it is to mimic it. What numbers would be valid to use? Thank you.
|
|
|
|
|
brettslote wrote:
I have a dialog box with 255 edit boxes,
I hope I never have to use your software ...
The other thing, are you sure you don't have conflicting IDs ? or are you sure you're using the good IDs ? the assertion seems to think that ( from CDataExchange::PrepareCtrl )
The resource IDs are sequential, no "real" patterns; I think that the upper limit is 32767 ( or something close to that )
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
|
Step through each statement in the DoDataExchange() function until you find the one that asserts.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
how to disable messager service?
thanks.
|
|
|
|
|
If you look at OpenSCManager() , OpenService() and ControlService() it should put you in good stead!
Ant.
|
|
|
|
|
Thanks!
schService = OpenService(
schSCManager, // SCM database
"Sample_Srv", // service name
SERVICE_ALL_ACCESS);
but what is the service name of messenger service?
sdfsdfffffffffffffffffffffffasdf
|
|
|
|
|