结构体数组初始化问题 请都各位,我用vb写activex dll控件用在网页上.里面我需要定义一个结构体数组.最好是动态的.事实上我做的时候总是会产生内在溢出提示"某某地址不能为写",我有什么好的办法解决内存溢出问题么?怎么初始化一个结构体?或产生一个动态的结构体数组? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Private Type linker_info DisplayName As String FirstName As StringEnd TypePrivate Sub synHostAndWeb() Dim strTmpUrl As String Dim lnCurRecord As Long Dim lnNumOfContacts As Long Dim lnTmp As Long Dim intCurContact As Integer Dim intRet As Integer gbWebMainInUse = True bolEndDown = False strTmpUrl = gsCallURL & "s_get.asp" webMain.Navigate strTmpUrl '''''''''''''出错的语句..只要执行到这里就会出错.但高手注意这条语句我 ''''''我在控件初始化的时候就调用过在那里是正常通过的啊. End SubPrivate Sub cmdSynStart_Click() cmdSynStart.Visible = False prgBar.Visible = True prgBar.Value = 10 timWait.Enabled = True Call synHostAndWebEnd SubPrivate Sub timWait_Timer() If InStr(1, strRetInfo, "#END PAGE#") Then bolEndDown = True timWait.Enabled = False prgBar.Value = prgBar.Value + 50 ElseIf secWaitTimer = 400 Then MsgBox "对不起,和主机联系失败请您重试!", vbOKOnly Or vbInformation, "出错!" timWait.Enabled = False cmdSynStart.Value = True Else prgBar.Value = prgBar.Value + secWaitTimer secWaitTimer = secWaitTimer + 1 End IfEnd SubPrivate Sub UserControl_Initialize() gbWebMainInUse = True webMain.Navigate "about:blank" Dim lnret As Long gsCallURL = Space(250) lnret = GetPrivateProfileString("CallSetting", "gsCallUrl", "", gsCallURL, 250, App.Path & "\setting.ini") gsCallURL = Trim(gsCallURL) gsCallURL = Mid(gsCallURL, 1, Len(gsCallURL) - 1) gsSystemLanguage = GetUserLanguage frmMain.blFirstLoad = True frmMain.Show If gbLogin = False Then cmdLogin.Visible = True cmdSynStart.Visible = False Else cmdLogin.Visible = False cmdSynStart.Visible = True End IfEnd Sub 我主要想想执行的就是通过webbrowse控件访问网页.但没想有有这种破烂问题...晕死我了.昨晚还把这个问题搞掂了.是那个结构数组的问题但没有保存.今天打开了VSS发现找不到那个可以执行的版本号了....哭.....高手救命啊.... 这个问题和结构体数组无关你先看看strTmpUrl = gsCallURL & "s_get.asp"之后strTmpUrl的内容是什么另外,可能是你的浏览器被劫持了,我建议你找一个干净的系统进行测试(最好是刚刚装好的),以便排除干扰 //我主要想想执行的就是通过webbrowse控件访问网页.但没想有有这种破烂问题...晕死我了.昨晚还把这个问题搞掂了.是那个结构数组的问题但没有保存从你的代码上看不出来这个问题,你定义的结构体 linker_info并没有在你的程序中使用 高手们...我找出了一个原因...就是我把写在最前的一句代码"dim webInfo as linker_info"去掉后就能通过了.但是我需要这个变量啊...我该怎么去初始化它呢??? //就是我把写在最前的一句代码"dim webInfo as linker_info"去掉后就能通过了.但是我需要这个变量啊...我该怎么去初始化它呢???你把代码贴全,在你给出的代码中没发现dim webInfo as linker_info这一句 今天又试了一次,发现根本不是这个问题.我写的是一个activex控件,用来跟网站进行勾通.但问题是我又重新写了一个空的ACTIVEX什么也不做就是在useractive里面添加一个webbrowser控件和一个按钮,当点击按钮的时候让webbrowser去navigate一个页面.结果我发现出现了同样的错误.并且出错的内在地址也一样...这是不是我的系统或vs有问题?我用的OS是windows2003,vs6.0英文企业版.但我保证这个webrowser 是可以使用的.因为我的active里还有一个窗口界面,里面有一个webbrowser是用来登录网站进行验证用的.这个webbrowser是能正常工作的但是回到了usercontrol里面就不行了呢??高手啊...救救我哟... 显示列表中指定数据的问题! 如何在窗体的指定位置显示气泡提示 如何统计一个免费软件的用户数量? 谁能帮忙解释一下这个算法 word中用vba怎样提取格式为“标题 3”的所有文本 设计好了的界面,偶而会发生某个控件丢失,遇见很多次了。有没有遇到的朋友啊。 VB如何调用程序打开各种文档? :):)******* 在vb中怎样取sql查询结果? 在线等候!立刻给分! VB程序如何支持多语种显示 VBA编译错误:找不到工程或库 请问一下怎样用VB实现象word一样打开文件然后执行的功能? 如何能做出类似PHOTOSHOP显示图层、颜色等那样的悬浮窗体?
DisplayName As String
FirstName As StringEnd TypePrivate Sub synHostAndWeb()
Dim strTmpUrl As String
Dim lnCurRecord As Long
Dim lnNumOfContacts As Long
Dim lnTmp As Long
Dim intCurContact As Integer
Dim intRet As Integer
gbWebMainInUse = True
bolEndDown = False
strTmpUrl = gsCallURL & "s_get.asp"
webMain.Navigate strTmpUrl '''''''''''''出错的语句..只要执行到这里就会出错.但高手注意这条语句我
''''''我在控件初始化的时候就调用过在那里是正常通过的啊.
End SubPrivate Sub cmdSynStart_Click()
cmdSynStart.Visible = False
prgBar.Visible = True
prgBar.Value = 10
timWait.Enabled = True
Call synHostAndWeb
End SubPrivate Sub timWait_Timer()
If InStr(1, strRetInfo, "#END PAGE#") Then
bolEndDown = True
timWait.Enabled = False
prgBar.Value = prgBar.Value + 50
ElseIf secWaitTimer = 400 Then
MsgBox "对不起,和主机联系失败请您重试!", vbOKOnly Or vbInformation, "出错!"
timWait.Enabled = False
cmdSynStart.Value = True
Else
prgBar.Value = prgBar.Value + secWaitTimer
secWaitTimer = secWaitTimer + 1
End If
End SubPrivate Sub UserControl_Initialize()
gbWebMainInUse = True
webMain.Navigate "about:blank"
Dim lnret As Long
gsCallURL = Space(250)
lnret = GetPrivateProfileString("CallSetting", "gsCallUrl", "", gsCallURL, 250, App.Path & "\setting.ini")
gsCallURL = Trim(gsCallURL)
gsCallURL = Mid(gsCallURL, 1, Len(gsCallURL) - 1)
gsSystemLanguage = GetUserLanguage
frmMain.blFirstLoad = True
frmMain.Show If gbLogin = False Then
cmdLogin.Visible = True
cmdSynStart.Visible = False
Else
cmdLogin.Visible = False
cmdSynStart.Visible = True
End IfEnd Sub
高手救命啊....
你先看看strTmpUrl = gsCallURL & "s_get.asp"
之后strTmpUrl的内容是什么
另外,可能是你的浏览器被劫持了,我建议你找一个干净的系统进行测试(最好是刚刚装好的),以便排除干扰
去掉后就能通过了.但是我需要这个变量啊...我该怎么去初始化它呢???
去掉后就能通过了.但是我需要这个变量啊...我该怎么去初始化它呢???
你把代码贴全,在你给出的代码中没发现dim webInfo as linker_info这一句