LabWindows/CVI

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

How do I create a directory within CVI?

How do I create a directory from within CVI?
0 项奖励
1 条消息(共 12 条)
7,429 次查看

Creates a new directory based on the specified directory name.

Note:  Only one directory can be created at a time.

/*-------------------- Prototype ---------------------*/
int MakeDir (char Directory_Name[]);

Utility Library\Diretory Utilities
Thanks.
CVI 2010
LabVIEW 2011 SP1
Vision Builder AI 2011 SP1
0 项奖励
2 条消息(共 12 条)
7,425 次查看

This seems really straight forward, but for some reason adding a call to MakeDir gives this error when I compile:

 

Undefined symbol '_MakeDir@4' referenced in "report.c"

 

However, I have included utility.h. So I'm not sure what the problem is. Also, the project is real-time only. Any ideas?

0 项奖励
3 条消息(共 12 条)
6,884 次查看

Maybe CreateDirectoryA might work (according to http://zone.ni.com/reference/en-XX/help/370051K-01/cvirtmodulehelp/windowssdkfuncsinrt/ this function should be available in RT)

For parameter definition see windows sdk help.

0 项奖励
4 条消息(共 12 条)
6,840 次查看

I found kernel32_lvrt.lib on my desktop. I couldn't find any header files. How do I go about including this library in my project?

0 项奖励
5 条消息(共 12 条)
6,838 次查看

windows.h

put it at top of your includes

0 项奖励
6 条消息(共 12 条)
6,833 次查看

Thanks, I'm having trouble finding documentation for the sdk library.

0 项奖励
7 条消息(共 12 条)
6,826 次查看

in CVI: Help/Windows SDK

 

What i forgot to say: you must have Windows SDK installed with CVI.

 

Here an extract:

 

BOOL CreateDirectory(
  LPCTSTR lpPathName,                         // directory name
  LPSECURITY_ATTRIBUTES lpSecurityAttributes  // SD
);

 

You can set lpSecurityAttributes to 0 for RT systems.

 

 

 

 

0 项奖励
8 条消息(共 12 条)
6,822 次查看

So am I to gather that the utility.h and/or the MakeDir method is not RT safe?  Is this why it does not work?

0 项奖励
9 条消息(共 12 条)
6,732 次查看

I don't know if it is safe or not. I only know that this function is not contained in the RT library.

 

Maybe a National Instruments representative can answer this question.

 

In the meantime you can use the SDK funktion.

... and while there is a workaround there is no need to change anything 眨眼表情

0 项奖励
10 条消息(共 12 条)
6,709 次查看