|
i can see the location of error when i double clicked .
this is the line which error appears in create_list.h
LIST* create_list(void)
|
|
|
|
|
well i solved the problem. and this is the most stupid problem i have ever faced. it takes for hours to see. i only changed the location include "structures.h" with include "create_list.h" . so know create_list function can realize the structures
|
|
|
|
|
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
I have created a test client application using WTClient.DLL to connect to matrikon OPC Server demo version. The WTClient.DLL has functions to interface the client application with the OPC Server. The client application basically exchange values with the server by creating the server tags (variables). The WTClient.DLL has callback functions used to update the client application tags with values from the server.
When there is an update of any of the value in the created tags the Matrikon OPC server issues callback to the client using the WTClient.DLL. Using the Callback function I update the changed values. However during sometimes after connecting my client application with the server, the callback does not happen even there is a change in the server data.
The code is as follows:
void CALLBACK EXPORT OPCUpdataCallback (HANDLE hGroup, HANDLE hItem, VARIANT *pVar, FILETIME timestamp, DWORD quality)
{
//Call to my function for updating the values (pVar) using the Handle hItem.
}
When I reopen my Client Application, it works fine. Again during sometimes the problem comes and so my application becomes unreliable.
Anybody Kindly help me to find out why my callback is not called from the server. My server is a standard application which is not supposed to have any errors
modified on Saturday, April 30, 2011 7:49 AM
|
|
|
|
|
Since this is an intermittent problem, it might be hard to track down. You need to strip down your client to the smallest possible app, that demonstrates this problem. Does the matrikon OPC Server come with source code for a demo client? If so, does that demo exhibit the problem? Again, try to boil it down to the smallest possible app. It is also very important to check the return codes of all functions, to see if there is an error.
If none of this works out, then check if there is a user forum for matrikon OPC Server. It might be something simple, which can be answered quickly.
Finally, of course, you could simply send an email to the vendor (I'm assuming matrikon OPC Server is a commercial product).
|
|
|
|
|
Just SendMessge to the Button IDC_BUTTON1 and make sure the button will be clicked
what's the code ?
thanks for help!
|
|
|
|
|
If you're not using MFC, the following would be the code, where hDlg is the handle to the dialog hosting the button -
::SendMessage(hDlg, WM_COMMAND, (BN_CLICKED << 16) | IDC_BUTTON1, ::GetDlgItem(hDlg, IDC_BUTTON1);
If you're using MFC, the following would be the version if you're calling it from within the dialog class -
SendMessage(WM_COMMAND, (BN_CLICKED << 16) | IDC_BUTTON1, GetDlgItem(IDC_BUTTON1));
|
|
|
|
|
ERROR,parameter 3...
SendMessage(WM_COMMAND, ((WPARAM)BN_CLICKED)<<8|(WPARAM)IDC_BUTTON, 0L); is that right?
I want the Button will be clicked down when the Message send,but there's nothing happened with the Button while the Message sent ,why
|
|
|
|
|
If you want to emulate a human pressing a button, then you will have to perform the actions a human performs:
1. Press button: send WM_LBUTTONDOWN
2. Hold button down a while: use SetTimer() or similar to implement delay.
3. Release button: send WM_LBUTTONUP.
|
|
|
|
|
Why did you not use the code that Superman posted? Re-read his answer and select the appropriate one (MFC or non-MFC) and use copy & paste to add to your project.
The best things in life are not things.
|
|
|
|
|
I got a error with it in my MFC app
Error 1 error C2664: 'CWnd::SendMessageW' : cannot convert parameter 3 from 'CWnd *' to 'LPARAM'
|
|
|
|
|
Just use a cast thus:
SendMessage(p1, p2, (LPARAM)p3 ...
You should really study and understand these basics of C++ before embarking on advanced projects such as you describe.
The best things in life are not things.
|
|
|
|
|
yea,I use
SendMessage(WM_COMMAND,(BN_CLICKED)<<16|IDC_BUTTON1,(LPARAM)GetDlgItem(IDC_BUTTON1));
it's passed in Compiling but pop up a Assertion Failded when running
> mfc100ud.dll!CWnd::OnCommand(unsigned int wParam, long lParam) Line 2708 + 0x27 bytes C++
so I changed it in Release Configuration,no Assertion Failed pop up ,why?
|
|
|
|
|
asserts don't get compiled in release code - they are a debugging tool and have little value in release code - i.e. the problem is still there in release code, you just didn't get a popup
In that code nugget the assert could be caused by an invalid window, are your sure that the window you are in is the immediate parent of the button
you'd normally be in a CDialog... class for this to work
|
|
|
|
|
What are the values of wParam and lParam , and what assertion did you receive?
The best things in life are not things.
|
|
|
|
|
NO.
Just send BM_CLICK (!)
|
|
|
|
|
hi all....! i got a project to make compressor like winrar on mfc which can compress or decompress any file.... pls let me know what i have to do for it.....! how to start it ...!~
|
|
|
|
|
You could start off by reading about Data Compression[^], and when you have a specific question ask again here.
|
|
|
|
|
hmaz4629 wrote: i got a project...
Personal or school?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
|
Ok, so what preliminaries has your instructor given? Since academic coding is usually comprehensive, what other assignments have you completed that this one will build upon? Have you asked your instructor for guidance?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
well my constructor just told me that you have to make a compression on mfc and the thing you will use is to assign lowest frequency to the highest occuring number or digit or character or anything .
the code type you have to write is called huffman code
it is a type of tree which has branches
mean each linklist bo have link of two next boxes.
i have started using MFC week ago
and i have chosen this project because i need bonus to improve my grade
|
|
|
|
|
hmaz4629 wrote: well my constructor just told me...
When your constructors start talking to you, it's time for a break!
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
Since you have posted the question in MFC forum i think you WANT CODE IN mfc.Read about data compression and look at this opensource compressor for reference.(learn and develop don't copy it )
7 ZIP:
http://sourceforge.net/projects/sevenzip/[^]
|
|
|
|
|
yeah i wanna learn not to copy thanks
|
|
|
|