|
neha.agarwal27 wrote: Can anybody tell me what might be the error....
"The specified resource name cannot be found in the image file. "
With Visual studio there is a tool called error look. You can enter the error code and it will show you the error string.
To take error lookup from visual studio take "tools menu->Error Lookup"
|
|
|
|
|
Winerror.h:
#define ERROR_RESOURCE_NAME_NOT_FOUND 1814L
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
How can i remove this error??
|
|
|
|
|
Simply make sure the resource is indeed in the image file.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
I am trying to receive udp packets which contains video data. I am receiving WSAEWOULDBLOCK error always.Can any one help me
The code is
WSADATA wsaData;
int error = WSAStartup(0x202,&wsaData);
if(error)
return FALSE;
if(wsaData.wVersion != 0x202)
{
WSACleanup();
return FALSE;
}
m_UdpSock=(SOCKET)WSASocket(AF_INET,SOCK_DGRAM,0,NULL,NULL,0);
if(m_UdpSock==INVALID_SOCKET)
return FALSE;
sockaddr_in sockAddrServer;
sockAddrServer.sin_family=AF_INET;
sockAddrServer.sin_port=htons(port_data);
sockAddrServer.sin_addr.s_addr=INADDR_ANY;
// Bind socket to listener address
if(bind(m_UdpSock,(SOCKADDR*)&sockAddrServer,sizeof(sockaddr_in))==SOCKET_ERROR)
{
int y=WSAGetLastError();
printf("Unable to bind socket\n");
return FALSE;
}
// Create WinSock Event object
WSAEVENT eventWinsock=(WSAEVENT)WSACreateEvent();
if(eventWinsock==WSA_INVALID_EVENT)
{
printf("Unable to create winsock event\n");
return FALSE;
}
// Signal WinSock Event on receive packet
if(WSAEventSelect(m_UdpSock,eventWinsock,FD_READ)!=NOERROR)
{
printf("Unable to connect event to socket\n");
return FALSE;
}
while(m_abort)
{
Recvbuf=new char[BUFFER_SIZE];
if(WaitForSingleObject(eventWinsock,INFINITE)== WAIT_OBJECT_0)
{
sockaddr_in sockAddrRecv;
int nSockAddrSize=sizeof(sockaddr_in);
// Packet received
EnterCriticalSection(&m_cs);
int nErr=recvfrom(m_UdpSock,Recvbuf,BUFFER_SIZE,0,(sockaddr*)&sockAddrRecv,&nSockAddrSize);
LeaveCriticalSection(&m_cs);
if(nErr==SOCKET_ERROR)
{
nErr=WSAGetLastError();
if(nErr==WSAEWOULDBLOCK)
{
WSANETWORKEVENTS wsevents;
WSAEnumNetworkEventsm_UdpSock,eventWinsock,&wsevents);
DWORD dwEventId = WaitForSingleObject(eventWinsock,3000);
if(dwEventId == WAIT_TIMEOUT)
continue;
continue;
}
}
else
{
TRACE("Receive Data Size %d\n",nErr);
BYTE init=Recvbuf[0];
TRACE("Packet Size for Init %d =%d and index=%d \n",init, nErr,index);
}
|
|
|
|
|
WSACreateEvent() creates a manual reset event, but I don't see anywhere
that you reset the event after waiting on it. Without resetting it,
you end up in a busy loop in between received datagrams.
*edit* Your WSAEnumNetworkEvents() call resets the event, but only every <br />
other time through the loop. You'll probably want to fix the logic there :)<br />
Either use an auto-rest event or always call WSAEnumNetworkEvents() after the event<br />
is signaled, not just if there's a WSAEWOULDBLOCK error.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
modified on Wednesday, April 23, 2008 3:36 AM
|
|
|
|
|
How to reset please explain
|
|
|
|
|
See my modified post
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
I am just trying to execute the gridctrl_demo225 project.
But it is showing an error like "unsupport operation was attempted".
This error is in both unicode and normal configurations.
Please help me in knowing the problem.
Thanks in advance.
Sunil.
|
|
|
|
|
Probably some DDX/DDV issue?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
I have been trying to open particular registry key to know the version of Outlook currently installed on the PC. Here is the piece of code
HKEY hKey;
CString strKey = _T("Outlook.Application\\CurVer");
if (::RegOpenKeyEx(HKEY_CLASSES_ROOT, strKey, 0, KEY_READ, &hKey) == ERROR_SUCCESS)
{
// do something
}
else
{
DWORD dwError = GetLastError();
}
The above piece of code fails to open the registry key and the GetLastError() returns error no. 122 which says "The data area passed to the system call is too small"
I have administrative privilege on the PC, but this piece of code fails to open the key, what could be the reason, and how do I interpret the error returned?
Thanx.
|
|
|
|
|
vipin_nvk wrote: if (::RegOpenKeyEx(HKEY_CLASSES_ROOT, strKey, 0, KEY_READ, &hKey) == ERROR_SUCCESS)
Change the parameter value instead of "KEY_READ" give "KEY_ALL_ACCESS"...
I'm not sure,whther this will work ..but try...
Born to win...!
|
|
|
|
|
This piece of code works fine at my place but fails with the above mentioned error at the client's place, so I wanted to know as to what could lead to the ERROR_INSUFFICIENT_BUFFER error so that it can be fixed and then sent across to the client. Do you think changing access to KEY_ALL_ACCESS will really work?
|
|
|
|
|
vipin_nvk wrote: Do you think changing access to KEY_ALL_ACCESS will really work?
No, the changing key access ...it wont solve ur problem..
It's something related to other problem...
Born to win...!
|
|
|
|
|
Manivannan@congruent wrote: Change the parameter value instead of "KEY_READ" give "KEY_ALL_ACCESS"...
As a matter of fact, that is a very bad suggestion. You should open a registry key only with the privileges that you may actually need.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Have you tried:
HKEY hKey;
LONG lResult = ::RegOpenKeyEx(HKEY_CLASSES_ROOT, _T("Outlook.Application\\CurVer"), 0, KEY_READ, &hKey);
if (lResult == ERROR_SUCCESS)
{
}
else
{
LPVOID lpMsgBuf;
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
lResult,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR) &lpMsgBuf,
0,
NULL);
...
LocalFree(lpMsgBuf);
}
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hello,
If my classes work fine and now I make dll's of the same then the classes give me Unhandled Exception.Is there anything that doesn't work if dll's are made?
Regards
Pritha
|
|
|
|
|
Did you try debugging to see what the exact problem is ?
|
|
|
|
|
Hello,
Yes I have made my menu without using resourses which works fine with my classes without dlls but with dlls the application cannot find the parent Mneu so it cannot replace the new menu
Pritha
|
|
|
|
|
Hello,
I have a class derived from CRichEditCtrl.
class CRICH : public CRichEditCtrl
{
}
In The above class I have a function
CRICH::GetCharPos()
{
SendMessage(EM_CHARFROMPOS,WPARAM ,LPARAM (5));
}
The above gives me Unhandled Exception but if I derive from CEdit I get the answer
What should I do to get the character position index from CPoint in CRichEditCtrl
Thanks
Pritha
|
|
|
|
|
prithaa wrote: SendMessage(EM_CHARFROMPOS,WPARAM ,LPARAM (5));
As per MSDN, the LPARAM is a pointer to POINTL structure. so you should modify the code as..
POINTL pt;
pt.x = 5;
pt.y= 5;
SendMessage(EM_CHARFROMPOS,0,LPARAM(&pt));
modified on Wednesday, April 23, 2008 2:57 AM
|
|
|
|
|
Hello,
WIll this work for CRichEditCtrl
Pritha
|
|
|
|
|
prithaa wrote: WIll this work for CRichEditCtrl
Is it very hard to try in your application???
MSDN:
Parameters
wParam
This parameter is not used.
lParam
The coordinates of a point in the control's client area.
The coordinates are in screen units and are relative to the upper-left
corner of the control's client area.
Rich edit controls: A pointer to a POINTL structure that contains the
horizontal and vertical coordinates.
Edit controls: The low-order word contains the horizontal coordinate.
The high-order word contains the vertical coordinate.
|
|
|
|
|
prithaa wrote: SendMessage(EM_CHARFROMPOS,WPARAM ,LPARAM (5));
Why are you not calling the base class implementation instead?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thanks Naveen
It worked.
Thanks for everybody's help
|
|
|
|