Quantcast
Channel: MicroStation Programming Forum - Recent Threads
Viewing all articles
Browse latest Browse all 7260

Opening a text file in Microstation 8.05.00.64

$
0
0

Hello,

I'm new to Microstation MDL programming and trying to learn a few things. I have searched through out this forum and other sources but most of answers are related to C++ or VBA. 

I'm using Micostation V8 2004 and developing in C language at the moment. I'm trying to open a simple text file and read coordinates line by line. to troubleshoot this, I created a completely new file and called it fileopen.mc and below is it's content:

#include <mdl.h>
#include <tcb.h>
#include <mselems.h>
#include <userfnc.h>

int main(){
FILE *fp;
if (fopen_s(&fp , "text.txt","r") == 0)
{
mdlDialog_openInfoBox("File opened successfully");
}

return(0);
}

When I run the command: mcomp -i%MS%\mdl\include -i%MS%\mdl\include\stdlib "c:\Bentley\Docs\mdl\fileopen.mc", it compiles fine and it generates the fileopen.mo. But when I try to create the .ma file from it by running this command: mlink -a%MS%\mdlapps\fileopen.ma fileopen.mo, it gives me the below error message:

### C:\PROGRA~1\Bentley\Program\MICROS~1\mdl\library\builtin.dlo: ####Unresolved symbol fopen_s in fileopen.mo.

### C:\PROGRA~1\Bentley\Program\MICROS~1\mdl\library\builtin.dlo: Unrecoverable errors detected. Output file not created.

beside this, I also tried to use dlmSystem_mdlFopen but getting the same error message not being able to resolve symbol.

Can anyone tell me what am I doing wrong here?

Thanks,

Mo


Viewing all articles
Browse latest Browse all 7260

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>