LabWindows/CVI

取消
显示结果 
搜索替代 
您的意思是: 

How can I launch the default e-mail client?

I need my CVI 7.1 WinXP application to pop up a blank, pre-addressed e-mail. 'Kinda like a "mailto:name@domain.com" link would work in a browser. I've tried everything I can think of to do this using shell and system commands. I do not want to assume any particular e-mail client or browser on the client machine. But I will assume a Windows OS. Anyone have any tricks to do this?
0 项奖励
1 条消息(共 14 条)
6,089 次查看
I thought you could use ShellExecute for something like this... (IE):

ShellExecute( NULL, NULL, "mailto:person@company.com", NULL, NULL, 0);
And of course be sure and include the right headers and link to shell32.lib
2 条消息(共 14 条)
6,075 次查看
Call me crazy, but do I need the SDK to call that function? I don't currently have that function in my library.
0 项奖励
3 条消息(共 14 条)
6,063 次查看
Naa, your not crazy. Thats an API function alright. Its in Shell32.dll so your going to need to
link in the Shell32.llb and header file for this to work IMO.
0 项奖励
4 条消息(共 14 条)
6,065 次查看
As Chaos says, ShellExecute is part of the SDK.
From the project window, go to Edit > Add Files to Project >> Library (*.Lib) and browse to ...\CVI\SDK\lib\Shell32.lib.
Add these two includes to the top of your list in the .c file.
Note: delete the space after < (I added the space to fool the forum's HTML error detection).
#include < windows.h>
#include < shellapi.h>

//....
// where ever you want to mail:
ShellExecute( NULL, NULL, "mailto:someuser@somewhere.com", NULL, NULL, 0);
5 条消息(共 14 条)
6,053 次查看
Sounds like an easy plan, but shell32.lib doesn't exist on my machine. Of course shell32.dll does. I've searched high and low for this LIB but can't locate it. Should it have installed with CVI? Google didn't even turn anything up.
0 项奖励
6 条消息(共 14 条)
6,051 次查看
When you install CVI, you have the option of installing SDK. It sounds like you need to rerun the CVI install program and select the SDK.
7 条消息(共 14 条)
6,044 次查看
And you need to have CVI Full Development version to have the option to install the Windows SDK.
Bilal Durrani
NI
8 条消息(共 14 条)
6,023 次查看
I have Pro and I was able to get it all working by installing the SDK. Interesting note is that even if you don't have the SDK you get the file structure with the non-SDK install. This threw me off at first. But a full SDK install did the trick. Thanks for the help.
0 项奖励
9 条消息(共 14 条)
6,024 次查看
I used the following ...

ShellExecute( NULL, NULL, "mailto:someuser@somewhere.com?subject=hello&body=some text", NULL, NULL, 0);

to open up email application and create a new message

But having generated the message, how can CVI cause this new message to be sent?
0 项奖励
10 条消息(共 14 条)
5,609 次查看