Runtime error

Runtime error

Anonymous
Not applicable
652 Views
5 Replies
Message 1 of 6

Runtime error

Anonymous
Not applicable
I am developing this MFC dialog-based app, and after making some minor
modifications, i get an Autocad message:
"Unsupported operation atempted".

(VS6, ACAD2K)

Anybody met with this before?

TIA

alex
0 Likes
653 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable
Alex:

> "Unsupported operation atempted".

This usually means you forgot to set the correct MFC resource module
handle when attempting to create a dialog from a resource. 🙂
--
Owen Wengerd
President, ManuSoft ==> http://www.manusoft.com
VP Americas, CADLock, Inc. ==> http://www.cadlock.com
0 Likes
Message 3 of 6

Anonymous
Not applicable
Owen

Here are some code excerpts:

acrxEntryPoint()
{
case AcRx::kInitAppMsg:
.......
initApp();
.......
}
void InitApp()
{
........
acedRegCmds(......, &xwApp);
.......
}
void xwApp()
.......
startDlg();
.......
}
bool startDlg() //launches main dialog
{
CAcModuleResourceOverride useThisDllResource;
HWND hwndAcad=acedGetAcadFrame()->m_hWnd;
if(!hwndAcad) return Adesk::kFalse;
CWnd *pWnd = CWnd::FromHandle(hwndAcad);
if((g_dlg = new Cxw (pWnd)) == NULL) return Adesk::kFalse;
return g_dlg->Create (pWnd);
}
.......
.......
void Cxw::OnWrite()//launches a 2nd dialog on top of the 1st
{
//inserting a additional resource override here doesn't solve the
problem
CWriteDlg writeDlg;
writeDlg.DoModal();//here we get "Unsupported operation atempted".
}

am i missing something?
BTW everything worked smoothly until i modified something in the Cxw dialog
resource. Now, even
after reversing the change, i can't make it work.

thanks
--
"Owen Wengerd" wrote in message
news:[email protected]...
Alex:

> "Unsupported operation atempted".

This usually means you forgot to set the correct MFC resource module
handle when attempting to create a dialog from a resource. 🙂
--
Owen Wengerd
President, ManuSoft ==> http://www.manusoft.com
VP Americas, CADLock, Inc. ==> http://www.cadlock.com
0 Likes
Message 4 of 6

Anonymous
Not applicable
Can be a mismatch in resource IDs
Remove the generated aps-file, rebuid all and try again.

/Matt


"alex" wrote in message
news:[email protected]...
Owen

Here are some code excerpts:

acrxEntryPoint()
{
case AcRx::kInitAppMsg:
.......
initApp();
.......
}
void InitApp()
{
........
acedRegCmds(......, &xwApp);
.......
}
void xwApp()
.......
startDlg();
.......
}
bool startDlg() //launches main dialog
{
CAcModuleResourceOverride useThisDllResource;
HWND hwndAcad=acedGetAcadFrame()->m_hWnd;
if(!hwndAcad) return Adesk::kFalse;
CWnd *pWnd = CWnd::FromHandle(hwndAcad);
if((g_dlg = new Cxw (pWnd)) == NULL) return Adesk::kFalse;
return g_dlg->Create (pWnd);
}
.......
.......
void Cxw::OnWrite()//launches a 2nd dialog on top of the 1st
{
//inserting a additional resource override here doesn't solve the
problem
CWriteDlg writeDlg;
writeDlg.DoModal();//here we get "Unsupported operation atempted".
}

am i missing something?
BTW everything worked smoothly until i modified something in the Cxw dialog
resource. Now, even
after reversing the change, i can't make it work.

thanks
--
"Owen Wengerd" wrote in message
news:[email protected]...
Alex:

> "Unsupported operation atempted".

This usually means you forgot to set the correct MFC resource module
handle when attempting to create a dialog from a resource. 🙂
--
Owen Wengerd
President, ManuSoft ==> http://www.manusoft.com
VP Americas, CADLock, Inc. ==> http://www.cadlock.com
0 Likes
Message 5 of 6

Anonymous
Not applicable
Alex:

One of your dialogs is using a resource ID for which it can't find the
dialog resource. Check your dialog resources and make sure they match what
is specified in the code, then rebuild all to make sure the updated
resources are included in your module. 🙂
--
Owen Wengerd
President, ManuSoft ==> http://www.manusoft.com
VP Americas, CADLock, Inc. ==> http://www.cadlock.com
0 Likes
Message 6 of 6

Anonymous
Not applicable
Owen:

By Jove you were right.
One of the dialog resources - a static text - had indeed disappeared.
(How can it happen?)
Anyway, many thanks, it's driven me crazy.

alex
(i sent this to your mail by mistake. Sorry)

"Owen Wengerd" wrote in message
news:[email protected]...
Alex:

One of your dialogs is using a resource ID for which it can't find the
dialog resource. Check your dialog resources and make sure they match what
is specified in the code, then rebuild all to make sure the updated
resources are included in your module. 🙂
--
Owen Wengerd
President, ManuSoft ==> http://www.manusoft.com
VP Americas, CADLock, Inc. ==> http://www.cadlock.com
0 Likes