|
Iain Clarke wrote: Boo Cedric, Boo!
Definitely! That guy is too smart.
Iain Clarke wrote: ps, Noone's delivered your urgent drugs yet?
Nope my friend...But since you are such a nice guy, ...plz plz plz urgent!!!
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
|
|
|
|
|
CPallini wrote: Definitely! That guy is too smart.
Well, it seems that you really abuse drugs
|
|
|
|
|
Hi Pallini and Iain,
Thanks for your response.
But I still have that error.
Both the Characterset are set to the following:
Character Set: Use Unicode Character Set
Treat wchar_t as Built-in Type: No(/Zc:wchar_t-)\
thanks and regards,
Rajesh
|
|
|
|
|
sorry for the silly question, did you linked to the import library.
|
|
|
|
|
Yes Rajkumar,
I have linked to the import library.
thanks in advance,
regards,
Rajesh
|
|
|
|
|
you may inspect the import library for the symbol may be this(
[libexplorer addin^], [libdump^]) tools helps or by simply open in binary editor. But basically these meant the symbol are not properly created in the import library, possibly check dllexport declarator is used for the class in the DLL class declaration.
|
|
|
|
|
Rajesh_Parameswaran wrote: Hi Pallini and Iain,
Since it is a reply to a Cedric post, I assume you're looking for the widest audience.
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
|
|
|
|
|
Actually i saw that was replied to you, but when OP had seen world is behind "Plz sir slow down", he moved it there.
|
|
|
|
|
Possibly.
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
|
|
|
|
|
It seems a UNICODE vs ANSI build conflict, i.e. VC8 project makes UNICODE builds by default, while VC6 makes ANSI ones. Possibly you have a ANSI DLL and a UNICODE client. Try to change the client setting: choose Project->Properties menu item, then select Configuration Properties->General node and finally change the Character Set switch.
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
|
|
|
|
|
Coming back your original question, go back to basics.
Write a function such as:
int HowBigIsATCHAR (TCHAR i_is_a_letter)
{
return sizeof (i_is_a_letter);
}
not forgetting to use dllimport / export.
Try using it in a your client program.
See if you get link errors, and also what size it gives you.
The TCHAR thing may be a blind alley, and you are having linking trouble with constant sizeed arrays. I've never passed a big array be value before...
Try passing it as TCHAR **, and see if that helps?
Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
|
|
|
|
|
Hello From Huntington Beach.
I ahve a question for VS C++ 2005. Is it possible to pass a function declaration as functio paramter. Here is my code snippet below.
here the function that is invoking the action
void BINARY::get_tree()
{
// Presonition: teakes last remainder of stack
// Postcondition: Copies the final tree and then startest computing the expression
// Library used: stack.h tree.h and treeexpression.h
// local variables
binary_tree_node<char *=""> *temp_tree=new binary_tree_node<char *>;
// start the procedure
temp_tree=top(tree_construct);
full_tree=tree_copy(temp_tree);
tree_clear(temp_tree);
pop(tree_construct);
postorder(void compute_result(char *test),full_tree); // <- is this legal?
// end of the procedure
}
here is the post order template function:
template<class process,="" class="" btnode="">;
void postorder(Process f, BTNode* node_ptr)
{
// Precondition: takes function and tree pointer as parameters
// Postcondition: set post order results to function of choice
// Runtime: O(N)
// Local Variables: None
// start of the procedure
if(node_ptr!=NULL)
{
postorder(f,node_ptr->left());
postorder(f,node_ptr->right());
f(node_ptr->information()); //<- here is the function
}
// end of procedure
}
and this function send the data to void BINARY::compute_result()
Any ideas?
thanks Mikivy
|
|
|
|
|
mikyivy wrote: postorder(void compute_result(char *test),full_tree); // <- is this legal?
not the declaration, you can pass the function pointer.
postorder(compute_result, full_tree);
provided Process is defined as
typedef void (* Process)(char *test);
mikyivy wrote: void BINARY::compute_result()
[Added]
if compute_result is not a static member then you need to use pointer to member.
[/Added]
|
|
|
|
|
mikyivy wrote: postorder(void compute_result(char *test),full_tree); // <- is this legal?
No, but you could do something like:
postorder(compute_result, full_tree);
"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
|
|
|
|
|
mikyivy wrote: Hello From Huntington Beach.
HB! I spend a significant amount of time in HB
Greetings from Fullerton.
Cheers,
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
I am working on a hardware controller device which has a USB port I need to use to write commands to the controller.
I have been able to ennumerate the device and obtain the handle for that device using CreateFile().
But when I try to execute ReadFile() or WriteFile(), the function fails and GetLastError() returns ERROR_INVALID_FUNCTION.
My code looks like this:
HANDLE hUsbDevice = CreateFile(path.c_str(),GENERIC_READ|GENERIC_WRITE,
0, NULL, OPEN_EXISTING, 0, NULL);
if (hUsbDevice == INVALID_HANDLE_VALUE)
{
val = GetLastError();
cout<<"failed in CreateFile"<<" error: "<<val<<"\n" ;
}
else
{
char _send_buff[] = {'I','n','i','t','1','=','0','\0'};
int _send_size = sizeof(_send_buff);
int _wrstatus = 0;
DWORD _bytes_written = 0;
_wrstatus = WriteFile(hUsbDevice,_buff,_size,&_bytes_written,NULL);
if (!_wrstatus)
cout<<"\nError while writing port: "<<GetLastError()<<endl;
}
Where am I going wrong here
|
|
|
|
|
You know that USB is totally different than a serial port on this level ? You can't just open the 'port' and send data on it. Instead you get a handle from a device driver and you communicate with this driver. The driver is then in charge of the communication with the device. Did you receive any kind of information with the USB device ?
|
|
|
|
|
I do have some manuals but they do not say much. This USB port is an auxillary port of the controller. Normally it is not used.
But I do know the USB drivers. Could you please tell me the procedure to get the driver handle? Is there any article I can refer to?
|
|
|
|
|
koumodaki wrote: Could you please tell me the procedure to get the driver handle?
You have to use CreateFile but you need to supply the driver symbolic name. The only way to know it is to look through the documentation or ask the guys. Is there anything related to DeviceIOControl in your doc ?
There's no way we can help you here if you need to use DeviceIOControl because the codes you need to use are specific to the supplier.
|
|
|
|
|
I will have to look into the manual carefull now. Anyway thanks for the help.
|
|
|
|
|
Is it me, or are there a lot of "How do I talk to this USB device I have incomplete documentation for" questions lately?
A device driver does not actually have to provide an implentation of read or write. If it does not, then the user mode equivalents will fail too.
eg:
DriverObject->MajorFunction[IRP_MJ_CREATE] = ImcNullDispatch;
DriverObject->MajorFunction[IRP_MJ_CLOSE] = ImcNullDispatch;
DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = ImcIoCtl;
DriverObject->DriverUnload = ImcUnload;
That code was taken from a driver I wrote ages ago (function names change to protect the guilty). Not there is no
DriverObject->MajorFunction[IRP_MJ_READ] = ...
In which case, I bet it has a huge DeviceIOControl function.
So you'll have to go digging up information from the website of the controller device.
Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
|
|
|
|
|
|
Hi all,
I would like know whether anyone knows a good SMTP mail class or examples (in C++). I have made a quick search on Google but can't find anything descent. Can anyone please help.
Many thanks in advance
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
modified on Tuesday, May 13, 2008 9:27 AM
|
|
|
|
|
Programm3r wrote: I have made a quick search on Google
What about a quick search on CP [^]?
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
|
|
|
|
|
Thanks for the reply and link ... I'll see if I can find anything in C++ on how to send a mail in C++
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|