使用c程序将锁定mlock.c错误转换为pcl文件到pdf文件 [英] Convert pcl file to pdf file using c program getting locking mlock.c error

查看:153
本文介绍了使用c程序将锁定mlock.c错误转换为pcl文件到pdf文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我是c编程的新手。



我正在尝试使用c编程将pcl文件转换为pdf文件。但是当我的调试器到达下面的代码时,我得到了unhand-led异常。



int __stdcall ConvertPcl2PdfNt(char * InPclFilename,

char * OutPdfFilename,

char * par1,

char * par2,

char * par3,

char * par4 );;



错误部分代码:

iReturn = ConvertPcl2PdfNt(outfile_name,outfile_name_pdf,par1,par2,par3,par4);

在这里得到错误,如

void __cdecl _unlock(

int locknum



{< br $>
/ *

*离开关键部分。

* /

LeaveCriticalSection(_locktable [locknum] .lock) ;

}



错误:未处理的异常发生。



我知道背后的原因。每当已经转换的pdf文件处于打开状态时此错误提升。那么如何关闭该pdf或如何解决此问题请帮助我。



我尝试了什么:



i尝试从pcl文件转换为pdf文件。

我的文件我要转换(xxx.pcl)已经打开pdf格式(xxx.pdf)异常发生所以我需要解决这个

Hi i am very new to c programming .

i am trying to convert pcl file to pdf file using c programming. but when my debugger reaches the below code i am getting the unhand-led exception.

int __stdcall ConvertPcl2PdfNt( char *InPclFilename,
char *OutPdfFilename,
char *par1,
char *par2,
char *par3,
char *par4);

Error part code :
iReturn = ConvertPcl2PdfNt(outfile_name, outfile_name_pdf, par1, par2, par3, par4);
getting error here like
void __cdecl _unlock (
int locknum
)
{
/*
* leave the critical section.
*/
LeaveCriticalSection( _locktable[locknum].lock );
}

ERROR:unhandled exception occured.

I know the reason behind that. whenever already converted pdf files are in open state this error raising.So how can i close that pdf or how to solve this issue please help me in this.

What I have tried:

i have tried like whenever converting from pcl file to pdf file.
the file which i am going to convert (xxx.pcl) is already opened in the pdf format (xxx.pdf) exception occures so i need to resolve this

推荐答案

只需处理异常使用try catch块(参见 Exceptions - C ++ Tutorials [ ^ ])。



输出时文件存在并已使用PDF查看器打开它已被锁定。然后显示一条消息,告诉用户他必须关闭文件并重新开始转换。
Just handle the exception using a try catch block (see Exceptions - C++ Tutorials[^]).

When the output file exists and has been opened with a PDF viewer it is locked. Then show a message telling the user that he must close the file and restart the conversion.


这篇关于使用c程序将锁定mlock.c错误转换为pcl文件到pdf文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆