|
If you're using a C++ compiler (and probably you areusing it) then you should use the extern "C" construct to avoid C++ symbol mangling.
i.e.
extern "C"
{
int FAR PASCAL GetSignalValue(int m_lCurValue);
} and
extern "C"
{
int FAR PASCAL GetSignalValue(int m_lCurValue)
{
}
}
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
[My articles]
|
|
|
|
|
Thanks to all. I resolved that error. I declared the function in def as
GetSignalValue().It should be GetSignalValue.
|
|
|
|
|
Roay wrote: int FAR PASCAL GetSignalValue(int m_lCurValue)
Declare that as extern "C" - otherwise, the object file will export the C++ mangled name, not the unmangled name your DEF file expects to see.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
In COM_1.cpp file,Im having the definition for GetSignalValue() function as follows:
// COM.cpp: implementation of the CLogger class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "COM_1.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CCOM::CCOM()
{
}
int FAR PASCAL GetSignalValue(int m_lCurValue)
{
long lReturnValue = m_lCurValue;
m_lCurValue += 10;
return m_lCurValue;
}
In .def file I declared the function as follows:
; COM.def : Declares the module parameters for the DLL.
LIBRARY "COM"
DESCRIPTION 'COM Windows Dynamic Link Library'
EXPORTS
; Explicit exports can go here
; COM.cpp Ordinal Numbers 100 - 110
GetSignalValue @102
|
|
|
|
|
Hi!
By resolving the external symbol? Seriously, give a bit more detail, "Unresolved external symbol" is like you saying "the linker tells me something's missing". It usually means that you forgot to link to some library or forgot to define a variable you declared and used somewhere...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Hi sir, it is "All Power to the Imagination!"
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
[My articles]
|
|
|
|
|
These kinds of questions should be the easiest to answer, you just guess some answer, post it and consider the transaction done.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
|
Hi
How to set 3D border for Edit control,when creating dynamically?
WS_BORDER gives the control, a rectangular black border.
m_EditCtrl.Create( WS_VISIBLE |WS_TABSTOP| ES_NUMBER |WS_BORDER,
CRect( 81, 244, 122, 264 ),
this , 4500 );
Thanks in advance
|
|
|
|
|
BenjaminBruno wrote: How to set 3D border for Edit control,when creating dynamically?
You have to specify WS_EX_CLIENTEDGE for that
m_Edit.CreateEx( WS_EX_CLIENTEDGE, _T("Edit"), _T(""), WS_CHILD|WS_VISIBLE |WS_TABSTOP| ES_NUMBER ,CRect( 81, 244, 122, 264 ),this , 4500 );
|
|
|
|
|
I have a question regarding sockets. I am trying to write two programs that will establish connection between each other to send and receive massages. One program sets connection the code is the following:
struct in_addr convaddr;
BOOL flag=TRUE;
while (flag)
{
s= socket(AF_INET,SOCK_STREAM,0);
if (s == INVALID_SOCKET)
flag=TRUE;
else
flag=FALSE;
}
addr.sin_family = AF_INET;
addr.sin_port = htons(1026);
if (onemach)
addr.sin_addr.S_un.S_addr = inet_addr("127.0.0.1");
else
{
m_ServerIP=getIP();
convaddr.s_addr=atoi(m_ServerIP);
mip=inet_ntoa(convaddr);
addr.sin_addr.S_un.S_addr = inet_addr(mip);
}
flag=TRUE;
while (flag)
{
if (connect(s, (struct sockaddr *)&addr, sizeof(struct sockaddr))==0)
{
flag=FALSE;
}
else
{
Sleep(500);
}
}
And the other accepts connection:
while (flag)
{
sock= socket(AF_INET,SOCK_STREAM,0);
if (sock == INVALID_SOCKET)
flag=TRUE;
else
flag=FALSE;
}
sin.sin_family = AF_INET;
sin.sin_port = htons(1026);
sin.sin_addr.s_addr = INADDR_ANY;
int err=-1;
while (err==-1)
err=bind( sock, (LPSOCKADDR)&sin, sizeof(sin) );
err=-1;
while (err!=0)
err = listen( sock, SOMAXCONN); //SOMAXCONN defined as 5
SOCKET Recv;
SOCKADDR_IN from;
int fromlen=sizeof(from);
//gets the address and port of remote/distant comp.
Recv=accept(sock,(struct sockaddr*)&from, &fromlen);//waits for not defined time
hostIP=new char [37];
hostIP=inet_ntoa(from.sin_addr);
hostPort=htons(from.sin_port);
the problem is that sometimes it works correct: establishes connection and interchanges the massages and sometimes it can’t establish the connection, even if it gets right ip addresses. I will appreciate it greatly if anyone can help me to find where the error comes or to improve the code. Thanks in advance.
|
|
|
|
|
If you're using WinSock for this, you can get extra error information using WSAGetLastError[^] - I'd suggest you investigate a) which operation fails, and b) what the error code is.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi all,
How to free unsigned long pointer variable?
Thanks in advance
|
|
|
|
|
how did you allocate memory for it?
|
|
|
|
|
Hello Friends
I m using win32.im creating window based application.I m using WM_GETMINMAXINFO,but how do i know that a window is maximized or minimized?I tried with lparam structure also but i m not getting the specific which tells me that a window is minimized or maximized.
Thanks in advance.
Regards
Yogesh
|
|
|
|
|
yogeshs wrote: but how do i know that a window is maximized or minimized
You will get WM_SYSCOMMAND [^] message when a window is maximized or minimized.
|
|
|
|
|
thanx,this is working but suggest me something to minimize popup windows.ShoOwnedPOpups is not working dear.Isnt there any other method?
Thankx
|
|
|
|
|
Enumerate all the top level windows in the thread using the EnumThreadWindows() and then call ShowWindow( SW_MINIMIZE ) for each of them
|
|
|
|
|
when i use wm_syscommand then its SC_MINIMIZE is working fine but it is not calling SC_MAXIMIZE/SC_RESTORE when click on taskbar to open my window,it is calling SC_MAXIMIZE only when i right click on that and if i choose maximize.What should i do?
Thnx
|
|
|
|
|
Try the WM_SIZE message instead of WM_SYSCOMMAND then. The WPARAM of the WM_SIZE message will be SIZE_MINIMIZED or SIZE_MAXIMIZED when the windows is minimized or maximized.
|
|
|
|
|
with this i m also facing same prob,it is maximizing only when i right click and then i hv to choose.
If i m directly clicking on taskbar,it is only opening popup windows.
|
|
|
|
|
I got it but some other way dear.Thanks for all ur replies.
|
|
|
|
|
hi all,
I want to remove the 'X' close button from the DockablePane. But i want the Autohide button to be there .. Is there any way to do it??
Thanks in Advance
Regards
Samir Satardekar
|
|
|
|
|
That is easy!
There has two space to do this.
For example, you derive a class CFileViewWnd from CDockablePane.
Create an instance.
CFileViewWnd m_wndFileView;
1. When you create the pane.use this.
The default create method is
virtual BOOL CreateEx(DWORD dwStyleEx, LPCTSTR lpszCaption, CWnd* pParentWnd, const RECT& rect, BOOL bHasGripper, UINT nID, DWORD dwStyle, DWORD dwTabbedStyle = AFX_CBRS_REGULAR_TABS, DWORD dwControlBarStyle = AFX_DEFAULT_DOCKING_PANE_STYLE, CCreateContext* pContext = NULL);
the AFX_DEFAULT_DOCKING_PANE_STYLE defined is
static const DWORD AFX_DEFAULT_DOCKING_PANE_STYLE = AFX_CBRS_FLOAT | AFX_CBRS_CLOSE | AFX_CBRS_RESIZE | AFX_CBRS_AUTOHIDE;
So, you can remove the create flags "AFX_CBRS_CLOSE"
like this.
m_wndFileView.Create( strFileViewWnd, this, CRect( 0, 0, 200, 200 ), TRUE, ID_PANE_FILEVIEW_WND, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_LEFT | CBRS_FLOAT_MULTI, AFX_CBRS_REGULAR_TABS, AFX_CBRS_FLOAT | AFX_CBRS_RESIZE | AFX_CBRS_AUTOHIDE ) )
It's OK!
2. Use the method GetControlBarStyle() and SetControlBarStyle( dwStyle )
DWORD dwStyle = m_wndFileView.GetControlBarStyle();
dwStyle &= ~( AFX_CBRS_CLOSE | AFX_CBRS_FLOAT );
m_wndFileView.SetControlBarStyle( dwStyle );
It's OK !
Enjoy It !
http://blog.csdn.net/laiboy
|
|
|
|
|
works fine but when typing Alt+F4, the Pane closes if floating, how to avoid this ?
|
|
|
|