.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old February 2nd, 2011, 04:31 AM
Norbert Norbert is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2011
Posts: 2 Norbert User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 40 m 44 sec
Reputation Power: 0
Exclamation VB6-DLL used with vb.net

The construction:
I built a DLL in VB6 to do some database update.
I used this DLL in an vb.net-DLL. And this DLL is used in an VB6-exe.
I admit, a bit complicated, but everything works fine under XP and Windows 7 - as administrator.


The problem:
Running this programm on Windows 7 as non-admin I get this error-Massage:

System.Security.SecurityException: Insufficient security permissions to set the system date .
bei Microsoft.VisualBasic.CompilerServices.Utils.SetDa te(DateTime vDate)
bei Microsoft.VisualBasic.DateAndTime.set_Today(DateTi me Value)
bei SHInfoWDB.SHInfoWDBFenster.ButtonSpeichern_Click(O bject sender, EventArgs e)
bei System.Windows.Forms.Control.OnClick(EventArgs e)
bei System.Windows.Forms.Button.OnClick(EventArgs e)

I get this errormassage, but the databaseupdate has been realy made!
In this vb6-DLL there is no explicit setting of the sysdate or time!
I get this errormassage even when this DLL does nothing else than a return!


What I did:
I gave the VB6-DLL a strong name using tlbimp.
Tlbimp.exe C:\VBAPPS\CICMP\SHDLLVB6\SHFaktLib.DLL /Keyfile:C:\VBAPPS\CICMP\SHDLLVB6\StrongNameSHFaktL ib.SNK /out: C:\VBAPPS\CICMP\SHDLLVB6\SHFaktLibInterOP.DLL


I gave the vb.net DLL a strong name and registerd it.
C:\WINdows\Microsoft.NET\Framework\v2.0.50727\RegA sm.exe c:\Windows\system32\SHInfoWDB.dll /tlb: c:\windows\system32\SHInfoWDB.tlb /codebase

I gave to theese DLLs fullTrust with caspol.exe


Who can help me?
I am a little bit confused about the frameworkversions and caspos. Do I have to set it in that framworkversion an which the vb.net-DLL is built.
Or is caspol the wrong way to solve my problem?

Reply With Quote
  #2  
Old February 4th, 2011, 01:04 AM
Norbert Norbert is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2011
Posts: 2 Norbert User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 40 m 44 sec
Reputation Power: 0
Smile Solution

OK, guys.
I saw that my thread was viewed a few times, but there was now reply.
As I found out the solution, I understand why.

Here the solution:
In the parameterslist of the vb6-function-call there is a Date-Type. I passed a date with the "today"-Function.
THIS was the problem.
Passing "now" caused no errer.
Even a Date-Variable in which I stored before "Today" caused no error!

Here the exeample of the call: (Containing the errer-causing "Today" function)

SHFunktionenObj.KontaktEintragADO Me._SHInfoWDBAnzeiger.NummerKundeOderLieferant, Me._SHInfoWDBAnzeiger.KZKundeLieferant, _
Now, "WDB", Mid(Me.RichTextBoxLangtext.Text, 1, 50), "", IIf(Me.RichTextBoxLangtext.Text = "", "", Me.RichTextBoxLangtext.Rtf), _
"", "", Now, False, "A", "S", 0, Me._SHInfoWDBAnzeiger.Sachbearbeiter, "", "", Today, "", , , , , , , , Me._SHInfoWDBAnzeiger.ArtikelNummer)

My conclusion:
The today-function in the parameterlist is mis-interpreted by the framework or some very deep layer of the system.
I hope that no programmer ever will have this sophisticated problem. And if, I hope this article helps.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgramming.NET Development > VB6-DLL used with vb.net


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap