|
From MSDN:
A CResourceException object is generated when Windows cannot find or allocate a requested resource. No further qualification is necessary or possible.
It could be the the resource id for one of the resources is wrong. Check that all valid resource ids in resource.h have a corresponding resource in the .rc file.
I remember a while back I had a similar problem where my program would die on Windows 9x. It was because somehow the resource id ranges got messed up which were not valid for 9x machine ie. it was out of range. Once I corrected that it was all working fine.
|
|
|
|
|
Well, the resources are not really changed from what the ClassWizard so I don't think it's from that kind of mismatch. I only added 3 menu items and some dialog boxes to my project. The work that occurs is almost completely pure mathematical work plus periodic GDI drawing. I'll take a look at the OnPaint function and try to catch the exception there.
|
|
|
|
|
I did put a try block around each of 3 sections I have and the exception was caught. The exception gave the reason "A required resource was unavailable." I think the resource is tied to the drawing context instance in the function I'll have to investigate it further. I may have to put my OnPaint function in a critical section and use a single (binary) lock to control the flow. Also, if anyone wants to reply to add in regards to synchronization, I only have one UI thread doing work but it's calling back to the child view to tell it to redraw specific places.
|
|
|
|
|
I am working on project in VC++, i have to develop a GUI and i want to create a .exe file for my whole application.
So Please help me how to create .exe file dilog programming.
Sheshidar Patnam
|
|
|
|
|
If I understand you correctly, you've created a UI using the IDE, but you've not written the code to make it work. Either way, you need to compile the program and you will have your .exe. Make sure you compile a release version, and you will probably need to also distribute the MFC dll with the executable, and maybe more.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hello,
If I remember the shortcut key correctly, you should press ctrl+F5 for building and running your application. This process creates an executable for your current active project.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
How to get the right URL before navigating the web page in the CHtmlView?
Class CHTMLControl derived from CHtmlView, and over load the virtual function OnBeforeNavigate2.
I Navigate an URL as following:
CHTMLControl* pHTMLControl;
…
pHTMLControl->Navigate2(strURL);
In the opened web page, there is a link whose html code is below:
<A href='javascript:clickProcess("search");'>Free Search</A>
After clicking on this link in the html view, the following function is called
void CHTMLControl::OnBeforeNavigate2(LPCTSTR lpszURL, DWORD nFlags, LPCTSTR lpszTargetFrameName, CByteArray& baPostedData, LPCTSTR lpszHeaders, BOOL* pbCancel)
But in this function, the value of lpszURL is "javascript:clickProcess("search");"
How can I get the right URL of the next page before navigating it?
Thanks
|
|
|
|
|
Hi, im trying to make a windows media player plugin here for my job.
Ive read the msdn topics about, followed the examples and so on.
What i was trying to do is a plugin with a buttom (like msdn example) but when the user press it, it doesnt open a browser with a url, it just display the url inside the media player.
I found out this class and method:
IWMPPlayerServices::setTaskPaneURL
but im having some problems to instance this class...
Im not used with this kind of programation, just dont know what should i use to get a pointer to a IWMPPlayerServices object...
In the main plugin class body i tryed to declare it:
CComPtr<iwmpplayerservices> m_spServices;
but using it this way: m_pPlugin->m_spServices->setTaskPaneURL(Local, Url, Name);
aways return a segmentation fault... i think i should point something in m_spServices, just dont know how... can some one give me a hand?
|
|
|
|
|
Hi all gurus,
Is TAPI Version depedent ?
In My project I Use TAPI for data transmittion between computers with
different system.
In condition, Windows 2000 and Windows XP it works fine.
but when use windows 2000 and windows 98 .it doesn't work
in windows 2000 ,lineNegotiateAPIVersion . the lpdwAPIVersion is 2.2
in windows 98 lineNegotiateAPIVersion lpdwAPIVersion is 1.4
and in windows 2000 i use lineOpen .. with tapiversion 1.4
in windows 98 i use lineOpen with tapiversion 1.4
it both works fine.
Problem 1:
i dial from windows 98 to windows 2000. windows2000 answers OK .and
Connected.
but i dial from windows 2000 to windows 98 .the 98 doesn't receive any
event;
Problem 2:
When I had dialed from windows 98 to windows 2000. windows2000 answers OK
.and Connected.
I Write data from windows 98 to windows 2000 .it receivs the data
but when i write data from windows 2000 to windows 98 .it receives none.
i put it in debug mode in Windows 98. :the api ReadFile(hCommHandle,....);
returns 0 immdeatly.the GetLastError() returns 0;
is it the Problem. ?
What is the Main problem .How to deal it.
Or Can you suggest me another way to trans data with another techonoly.
Thanks in advice.
|
|
|
|
|
|
Hi
I'm working on an application that displays a lot of trend graphs and associated numerical values. These are updated on a regular scan in the OnIdle() function, with the processor running at full load.
I started off using InvalidateRect() on the trends and the values individually to minimise the area of each View that was redrawn on each scan, but the code got a bit complicated, so I changed it to group them together. The total area redrawn is now much larger, but the number of InvalidateRect() calls has halved. I expected that the program would run a little slower but to my surprise there is no noticable difference.
This gives me the impression that there is a considerable overhead associated with each InvalidateRect() call, and that if you get too fussy about drawing only those regions that have changed you rapidly run into dimishing returns. Does anyone know if this is a correct interpretation?
Thanks in advance for your help.
Cliff Hatch
-- modified at 7:32 Sunday 16th October, 2005
|
|
|
|
|
It sounds like a drawing problem not an InvalidateRect() problem. No matter what the size of the invalidated rectangular area is, if you are drawing the whole area instead of just drawing in the invalid area then the drawing speed will be uneffected.
Example, if you where designing a bitmap editor and modify the bitmap by adding a 10x10 pixel square, then you just want to redraw that 10x10 area in OnPaint(). If you where to just blit the whole bitmap each time OnPaint() was called, then drawing a simple line (via click and drag) becomes a nightmare.
The above also applies to text editors or any othe application that does a lot of drawing.
INTP
Every thing is relative...
|
|
|
|
|
Thanks for you comments John
|
|
|
|
|
Hi, I am trying to use 3rd party API interface in VC++ module. Below is all that I got in the package.
CdCore.dll
CdCore.lib
CdCored.dll
CdCored.lib
CdDefs.h
CdSdk.h
This is my program
#include <cstdio>
#include <conio.h>
#include <sys\types.h>
#include <string>
#include <iostream>
#include <afxwin.h>
#include "cdsdk.h" // Standard CDSDK header file
using std::cout;
CWinApp theApp; // Keep MFC library happy (console app)
/* Submit a process file, wait for completion and then */
/* display the statistic records for the prccess */
int main(int argc, char *argv[], char *envp[])
{
// Make sure that MFC has a valid resource handle (console app)
AfxSetResourceHandle(::GetModuleHandle(NULL));
try
{
// Connect to the node and issue the 'SELECT PROCESS' command
CDNode node("MYNODE", "MYUSER", "MYPASSWORD");
CDProcIterator it = node.SelectProc();
while (it.HasMore())
{
CDProcess proc = it.GetNext();
cout << proc.GetNumber();
cout << ' ';
cout << proc.GetName();
cout << ' ';
cout << proc.GetQueue();
cout << '\n';
}
}
catch (const CDMsgException &e) // Catch all C errors
{
for (int ii=0; ii < e.GetMsgCount(); ii++)
cout << e.GetMsg(ii) + "\n";
}
// Flush all output to the screen and wait ten seconds.
cout.flush();
Sleep(10000);
return 0;
}
My Error message
st4 - Win32 Debug--------------------
Compiling...
monTest4.cpp
c:\monica\workingfolder\sam\montest4\cddefs.h(771) : warning C4275: non dll-interface class 'CObject' used as base for dll-interface class 'CDData'
c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(666) : see declaration of 'CObject'
c:\monica\workingfolder\sam\montest4\cddefs.h(824) : warning C4275: non dll-interface class 'CObject' used as base for dll-interface class 'CDReference'
c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(666) : see declaration of 'CObject'
c:\monica\workingfolder\sam\montest4\cddefs.h(955) : warning C4275: non dll-interface class 'CObject' used as base for dll-interface class 'CDEvent'
c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(666) : see declaration of 'CObject'
c:\monica\workingfolder\sam\montest4\cddefs.h(992) : warning C4251: 'm_event' : class 'CEvent' needs to have dll-interface to be used by clients of class 'CDEvent'
c:\program files\microsoft visual studio\vc98\mfc\include\afxmt.h(121) : see declaration of 'CEvent'
c:\monica\workingfolder\sam\montest4\cddefs.h(993) : warning C4251: 'm_eventChangeWait' : class 'CEvent' needs to have dll-interface to be used by clients of class
'CDEvent'
c:\program files\microsoft visual studio\vc98\mfc\include\afxmt.h(121) : see declaration of 'CEvent'
c:\monica\workingfolder\sam\montest4\cdsdk.h(89) : warning C4275: non dll-interface class 'CWinThread' used as base for dll-interface class 'CDThread'
c:\program files\microsoft visual studio\vc98\mfc\include\afxwin.h(3791) : see declaration of 'CWinThread'
c:\monica\workingfolder\sam\montest4\cdsdk.h(112) : warning C4251: 'm_eventExit' : class 'CEvent' needs to have dll-interface to be used by clients of class 'CDThread'
c:\program files\microsoft visual studio\vc98\mfc\include\afxmt.h(121) : see declaration of 'CEvent'
c:\monica\workingfolder\sam\montest4\cdsdk.h(262) : warning C4251: 'm_strKqv' : class 'CString' needs to have dll-interface to be used by clients of class 'CDStatData'
c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(368) : see declaration of 'CString'
c:\monica\workingfolder\sam\montest4\cdsdk.h(330) : warning C4251: 'm_strDescription' : class 'CString' needs to have dll-interface to be used by clients of class
'CDMsgData'
c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(368) : see declaration of 'CString'
c:\monica\workingfolder\sam\montest4\cdsdk.h(384) : warning C4251: 'm_strIP' : class 'CString' needs to have dll-interface to be used by clients of class 'CDInitParmsData'
c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(368) : see declaration of 'CString'
c:\monica\workingfolder\sam\montest4\cdsdk.h(690) : warning C4251: 'm_strName' : class 'CString' needs to have dll-interface to be used by clients of class 'CDNodeData'
c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(368) : see declaration of 'CString'
c:\monica\workingfolder\sam\montest4\cdsdk.h(697) : warning C4251: 'm_cs' : class 'CCriticalSection' needs to have dll-interface to be used by clients of class 'CDNodeData'
c:\program files\microsoft visual studio\vc98\mfc\include\afxmt.h(145) : see declaration of 'CCriticalSection'
c:\monica\workingfolder\sam\montest4\cdsdk.h(1050) : warning C4251: 'm_astrPathNames' : class 'CStringArray' needs to have dll-interface to be used by clients of class
'CDNetmapNodeData'
c:\program files\microsoft visual studio\vc98\mfc\include\afxcoll.h(499) : see declaration of 'CStringArray'
c:\monica\workingfolder\sam\montest4\cdsdk.h(1460) : warning C4275: non dll-interface class 'CObject' used as base for dll-interface class 'CDMsgException'
c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(666) : see declaration of 'CObject'
c:\monica\workingfolder\sam\montest4\cdsdk.h(1525) : warning C4251: 'm_aMsgs' : class 'CArray<struct cdmsgexception::msg,struct="" cdmsgexception::msg="" const="" &="">' needs to have
dll-interface to be used by clients of class 'CDMsgException'
c:\monica\workingfolder\sam\montest4\cdsdk.h(1931) : warning C4251: 'm_eventComplete' : class 'CEvent' needs to have dll-interface to be used by clients of class
'CDProcData'
c:\program files\microsoft visual studio\vc98\mfc\include\afxmt.h(121) : see declaration of 'CEvent'
c:\monica\workingfolder\sam\montest4\cdsdk.h(2039) : warning C4275: non dll-interface class 'CDialog' used as base for dll-interface class 'CDExceptionDlg'
c:\program files\microsoft visual studio\vc98\mfc\include\afxwin.h(2568) : see declaration of 'CDialog'
c:\monica\workingfolder\sam\montest4\cdsdk.h(2051) : warning C4251: 'm_btnOK' : class 'CButton' needs to have dll-interface to be used by clients of class 'CDExceptionDlg'
c:\program files\microsoft visual studio\vc98\mfc\include\afxwin.h(2704) : see declaration of 'CButton'
c:\monica\workingfolder\sam\montest4\cdsdk.h(2051) : warning C4251: 'm_btnDetails' : class 'CButton' needs to have dll-interface to be used by clients of class
'CDExceptionDlg'
c:\program files\microsoft visual studio\vc98\mfc\include\afxwin.h(2704) : see declaration of 'CButton'
c:\monica\workingfolder\sam\montest4\cdsdk.h(2052) : warning C4251: 'm_wndMsg' : class 'CStatic' needs to have dll-interface to be used by clients of class 'CDExceptionDlg'
c:\program files\microsoft visual studio\vc98\mfc\include\afxwin.h(2676) : see declaration of 'CStatic'
c:\monica\workingfolder\sam\montest4\cdsdk.h(2052) : warning C4251: 'm_wndIcon' : class 'CStatic' needs to have dll-interface to be used by clients of class
'CDExceptionDlg'
c:\program files\microsoft visual studio\vc98\mfc\include\afxwin.h(2676) : see declaration of 'CStatic'
c:\monica\workingfolder\sam\montest4\cdsdk.h(2053) : warning C4251: 'm_edit' : class 'CRichEditCtrl' needs to have dll-interface to be used by clients of class
'CDExceptionDlg'
c:\program files\microsoft visual studio\vc98\mfc\include\afxcmn.h(1012) : see declaration of 'CRichEditCtrl'
c:\monica\workingfolder\sam\montest4\cdsdk.h(2058) : warning C4251: 'm_sizeDlgLarge' : class 'CSize' needs to have dll-interface to be used by clients of class
'CDExceptionDlg'
c:\program files\microsoft visual studio\vc98\mfc\include\afxwin.h(137) : see declaration of 'CSize'
c:\monica\workingfolder\sam\montest4\cdsdk.h(2059) : warning C4251: 'm_sizeDlgSmall' : class 'CSize' needs to have dll-interface to be used by clients of class
'CDExceptionDlg'
c:\program files\microsoft visual studio\vc98\mfc\include\afxwin.h(137) : see declaration of 'CSize'
c:\monica\workingfolder\sam\montest4\cdsdk.h(2290) : warning C4275: non dll-interface class 'CObject' used as base for dll-interface class 'CDCommand'
c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(666) : see declaration of 'CObject'
c:\monica\workingfolder\sam\montest4\cdsdk.h(2345) : warning C4251: 'm_strBaseCmd' : class 'CString' needs to have dll-interface to be used by clients of class 'CDCommand'
c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(368) : see declaration of 'CString'
c:\monica\workingfolder\sam\montest4\cdsdk.h(2346) : warning C4251: 'm_mpParmToValue' : class 'CMapStringToString' needs to have dll-interface to be used by clients of
class 'CDCommand'
c:\program files\microsoft visual studio\vc98\mfc\include\afxcoll.h(1386) : see declaration of 'CMapStringToString'
c:\monica\workingfolder\sam\montest4\cdsdk.h(2576) : warning C4251: 'm_strProcessText' : class 'CString' needs to have dll-interface to be used by clients of class
'CDSubmitCmd'
c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(368) : see declaration of 'CString'
c:\monica\workingfolder\sam\montest4\cdsdk.h(2577) : warning C4251: 'm_strFilename' : class 'CString' needs to have dll-interface to be used by clients of class
'CDSubmitCmd'
c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(368) : see declaration of 'CString'
c:\monica\workingfolder\sam\montest4\cdsdk.h(2578) : warning C4251: 'm_mpstrstrSymbolics' : class 'CMapStringToString' needs to have dll-interface to be used by clients of
class 'CDSubmitCmd'
c:\program files\microsoft visual studio\vc98\mfc\include\afxcoll.h(1386) : see declaration of 'CMapStringToString'
c:\monica\workingfolder\sam\montest4\cdsdk.h(2676) : warning C4275: non dll-interface class 'CDialog' used as base for dll-interface class 'CDLogonDlg'
c:\program files\microsoft visual studio\vc98\mfc\include\afxwin.h(2568) : see declaration of 'CDialog'
c:\monica\workingfolder\sam\montest4\cdsdk.h(2681) : warning C4251: 'm_strNode' : class 'CString' needs to have dll-interface to be used by clients of class 'CDLogonDlg'
c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(368) : see declaration of 'CString'
c:\monica\workingfolder\sam\montest4\cdsdk.h(2682) : warning C4251: 'm_strPassword' : class 'CString' needs to have dll-interface to be used by clients of class
'CDLogonDlg'
c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(368) : see declaration of 'CString'
c:\monica\workingfolder\sam\montest4\cdsdk.h(2683) : warning C4251: 'm_strUser' : class 'CString' needs to have dll-interface to be used by clients of class 'CDLogonDlg'
c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(368) : see declaration of 'CString'
c:\monica\workingfolder\sam\montest4\cdsdk.h(2685) : warning C4251: 'm_strTitle' : class 'CString' needs to have dll-interface to be used by clients of class 'CDLogonDlg'
c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(368) : see declaration of 'CString'
c:\monica\workingfolder\sam\montest4\cdsdk.h(2903) : warning C4251: 'm_strName' : class 'CString' needs to have dll-interface to be used by clients of class 'RegValue'
c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(368) : see declaration of 'CString'
c:\monica\workingfolder\sam\montest4\cdsdk.h(3006) : warning C4251: 'lcuFile' : class 'std::basic_fstream<char,struct std::char_traits<char=""> >' needs to have dll-interface
to be used by clients of class 'LCUNodeProperties'
c:\monica\workingfolder\sam\montest4\cdsdk.h(3008) : warning C4251: 'm_strNode' : class 'CString' needs to have dll-interface to be used by clients of class
'LCUNodeProperties'
c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(368) : see declaration of 'CString'
c:\monica\workingfolder\sam\montest4\cdsdk.h(3009) : warning C4251: 'm_strAddress' : class 'CString' needs to have dll-interface to be used by clients of class
'LCUNodeProperties'
c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(368) : see declaration of 'CString'
c:\monica\workingfolder\sam\montest4\cdsdk.h(3010) : warning C4251: 'm_strPort' : class 'CString' needs to have dll-interface to be used by clients of class
'LCUNodeProperties'
c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(368) : see declaration of 'CString'
c:\monica\workingfolder\sam\montest4\cdsdk.h(3011) : warning C4251: 'm_strUserID' : class 'CString' needs to have dll-interface to be used by clients of class
'LCUNodeProperties'
c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(368) : see declaration of 'CString'
c:\monica\workingfolder\sam\montest4\cdsdk.h(3012) : warning C4251: 'm_strPassword' : class 'CString' needs to have dll-interface to be used by clients of class
'LCUNodeProperties'
c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(368) : see declaration of 'CString'
Linking...
nafxcwd.lib(afxmem.obj) : error LNK2005: "void __cdecl operator delete(void *)" (??3@YAXPAX@Z) already defined in libcpmtd.lib(delop.obj)
monTest4.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class CString __thiscall CDMsgException::GetMsg(int)const "
(__imp_?GetMsg@CDMsgException@@QBE?AVCString@@H@Z)
Debug/monTest4.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
monTest4.exe - 3 error(s), 42 warning(s)
|
|
|
|
|
maybe you need to use MDd/MD runtime library. and use mfc in shared dll.
|
|
|
|
|
Many Thanks for trying to help. But I'm still having problems.
I have set my General->Microsoft Foundataion Classes option to "use shared dll" and also set use of runtime libary to multithreaded dll. I still get this error. Please help.
Linking...
monTest4.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class CString __thiscall CDMsgException::GetMsg(int)const " (__imp_?GetMsg@CDMsgException@@QBE?AVCString@@H@Z)
Release/monTest4.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
monTest4.exe - 2 error(s), 0 warning(s)
|
|
|
|
|
Here is my problem:
I need a way to encode X and Y (can be negative numbers and equals) to return me a N integer number always diferent.
(x=2,y=2) = N
(x=-2,y=2) = different N
(x=0,y=0) = another different N
Understand me? Anyone can help me? Thanks in advanced!
|
|
|
|
|
can any two pairs of X and Y ever give the same N ?
ex.: X1, Y1 = N1 and X2, Y2 = N1 ?
if not, my first guess is that you can't do it, using 32 bit integers for X,Y and N. you need 64 bits to represent 32x2 bits of input data if you can't have collisions.
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
No N should never be the same, that's the main propose :\
My hope is that we can do it only with 'some math'!
|
|
|
|
|
Do you want to generate a unique value called N?
-prakash
|
|
|
|
|
No, any X and Y should give a unique N
(X=2,Y=2) should return always the same N
(X=1,Y=3) should always return any other N
N can be any integer
|
|
|
|
|
But there are much more (X,Y) pairs than Ns, so every pair can't have unique N.
|
|
|
|
|
Problem is:
1. I have to, in some way, save points (x,y) to a skiplist
2. I've to search for that point in that skiplist and return true if is in it otherwise false.
3. But how can I search for a point that is not a single integer? How can I compare if it's higher or lower to go to next node?
|
|
|
|
|
Mal-Functi wrote: But how can I search for a point that is not a single integer? How can I compare if it's higher or lower to go to next node?
have you tried:
if X1 > X2 then
if Y1 > Y2 then
P1 is > P2
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
Hello,
You can try the following:
std::pair<int, int> PointPair(x,y);
if( PointPair > PPn )
{ }
Hope this helps
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|