首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > PB >

PB转VC解决办法

2012-03-22 
PB转VC公司最近要用VC做一个(扩展储存过程).dll的文件,用SQL调用,请各位老大帮忙把这段PB代码改成VC(扩展

PB转VC
公司最近要用VC做一个(扩展储存过程).dll的文件,用SQL调用,请各位老大帮忙把这段PB代码改成VC(扩展储存过程).dll的代码.

//string of_encrypt(stringas_source)

long i
long ll_len
string ls_text
string ls_result

ls_text = trim(as_source)
ll_len = len(ls_text)
ls_result = ""
ls_text = reverse(ls_text)
FOR i = 1 TO ll_len
ls_result = ls_result + char(asc(mid(ls_text,i,1)) + ((ll_len - i - 2) * 2))
NEXT
RETURN ls_result

[解决办法]
漏了一行,呵呵
int i ; 
int ll_len ; 
CString ls_text ; 
CString ls_result = "" , ls_tmp ; 
char ch ; 

ls_text = as_source ; 
ls_text.TrimRight() ; 
ll_len = ls_text.GetLength() ;
ls_text.MakeReverse() ; 
for(i=0;i <ll_len;i++) 

ch = ls_text.GetAt(i) ; 
ch += (ll_len - i - 2) * 2 ;
ls_tmp.Format("%c",ch) ; 
ls_result += ls_tmp ; 

return ls_result ;
[解决办法]
你只include下面三个头文件试试
#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
malloc和free方法应该都在malloc.h头文件中定义。
afx.h是MFC的头文件。

热点排行