|
|
Much appreciated!
Thanks for all the help
|
|
|
|
|
--> i am using the following code in crystal reports XI's formula...
if isnull({vSTUDENT_FEE_DETAIL.Admission}) then
formula = "ooooo"
else
formula = "yyyyy"
end if
--> i am not getting the expecting result.
--> if the ADMISSION is NULL then it should print "ooooo" else "yyyyy".
--> when it is not NULL it displays the right result that is "yyyyy", but when it is NULL then it displays nothing..
--> ADMISSION is the field in the database table.
--> give me any clue.
--> thanks....
J A Nasir K
modified on Thursday, May 21, 2009 4:30 PM
|
|
|
|
|
Jamal Abdul Nasir wrote: --> give me any clue.
3.
|
|
|
|
|
42
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
--> wat do u mean by "3".?
J A Nasir K
|
|
|
|
|
|
Perhaps ADMISSION isn't null (with no value at all), but just an empty string. Alternatively, since that in itself wouldn't produce the result you received, you may be terminating program flow if ADMISSION is null before you ever actually get to the condition
|
|
|
|
|
--> actually Admission got values and null values as well. stil have a problem...
J A Nasir K
|
|
|
|
|
Try using: if vSTUDENT_FEE_DETAIL.Admission Is Nothing then
hth
Like car accidents, most hardware problems are due to driver error.
Samir R. Ibrahim
|
|
|
|
|
--> this the code in the crystal report's formula. it does not support nothing in there.
J A Nasir K
|
|
|
|
|
Jamal Abdul Nasir wrote: this the code in the crystal report's formula
Would have been useful in the OP.
if you own the select change the select/proc to return a non null value
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Don't tell any one
Like car accidents, most hardware problems are due to driver error.
Samir R. Ibrahim
|
|
|
|
|
I'll try to explain my problem using an example.
I have 2 classes (Class1 and Class2). I would like to insert pointers to instances of Class1 in an array that represents a property of class 2
This is the code:
Public Class Class1
Dim ciao As String = "Hello world"
Sub showciao()
MsgBox(ciao)
End Sub
End Class
Public Class class2
Public classi() As Class1
'HERE I DEFINE A METHOD TO CREATE A POINTER TO AN ISTANCE OF CLASS1 AND TO PUT IT IN AN ARRAY
Sub putclass2to1(ByVal index As Integer, ByRef classe1scelta As Class1)
classi(index) = classe1scelta
End Sub
End Class
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim c1 As Class1 'declare one object of class1
Dim c2 As class2 'declare one object of class2
c2.putclass2to1(1, c1) 'call the method to put a pointer to c1 in a row of the vector of c2
c2.classi(1).showciao() ' call a metod of c1 using c2 in order to verify that the pointer works
End Sub
UNFORTUNATELY I get in correspondence of the privatesub this error "Object reference not set to an instance of an object."
Where Am I doing wrong? where is the mistake? Please help me!
Thank you in advance for your help.
End Class
|
|
|
|
|
nico2007 wrote: Dim c1 As Class1 'declare one object of class1
Dim c2 As class2 'declare one object of class2
You haven't created an object of these two classes. You just declared to variables that can HOLD an object of those types. You haven't actually created an instance of them yet.
|
|
|
|
|
I forgot to use the word New in my example but I used it in the code.
Dim c1 as new class1
dim c2 as new class2
or
dim c1= new class1
....
But I still get that error!
|
|
|
|
|
Copy and paste the ACTUAL code in use. Don't retype it or guess at it. You're going to miss something.
|
|
|
|
|
Your issue is that you never redim'd classi() as class1. so while in routine putclass2to1 you are trying to fill classi(index) when classi has been properly created...
'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous
'Life's real failure is when you do not realize how close you were to success when you gave up.' ~ anonymous
|
|
|
|
|
nico2007 wrote: Public Class class2
Public classi() As Class1
'HERE I DEFINE A METHOD TO CREATE A POINTER TO AN ISTANCE OF CLASS1 AND TO PUT IT IN AN ARRAY
Sub putclass2to1(ByVal index As Integer, ByRef classe1scelta As Class1)
classi(index) = classe1scelta
End Sub
End Class
You need to initialize your classi() array I guess.
Regards: Didi
|
|
|
|
|
please let me know if somebody used this function and reply me how to used it in VB 6.0
|
|
|
|
|
Try the following code:
Public Function SignMsg(CertContext As Long) As Boolean
Dim SigParams As CRYPT_SIGN_MESSAGE_PARA
Dim MessageArray(0 To 0) As String
Dim MessageSizeArray(0 To 0) As Long
Dim cbSignedMessageBlob As Long
Dim pbSignedMessageBlob As String
Dim GLE As Long
Dim rtn As Boolean
Const szOID_RSA_ENCRYPT = "1.2.840.113549.3"
Const szOID_OIWSEC_sha1 = "1.3.14.3.2.26"
On Error GoTo erh
SigParams.dwMsgEncodingType = PKCS_7_ASN_ENCODING
SigParams.pSigningCert = CertContext
SigParams.HashAlgorithm.pszObjId = szOID_OIWSEC_sha1
SigParams.HashAlgorithm.Parameters = 0
SigParams.cMsgCert = 1
SigParams.rgpMsgCert = CertContext
SigParams.cAuthAttr = 0
SigParams.dwInnerContentType = 0
SigParams.cMsgCrl = 0
SigParams.cUnauthAttr = 0
SigParams.dwFlags = 0
SigParams.pvHashAuxInfo = 0
SigParams.rgAuthAttr = 0
SigParams.cbSize = Len(SigParams)
MessageArray(0) = "A message" + vbNullChar
MessageSizeArray(0) = Len(MessageArray(0))
rtn = CryptSignMessage(VarPtr(SigParams), _
False, _
1, _
MessageArray, _
MessageSizeArray, _
0, _
VarPtr(cbSignedMessageBlob) _
)
GLE = GetLastError
If rtn = False Then
err.Raise 4021, , "Failed to retrieve signed blob size: " & GLE
End If
pbSignedMessageBlob = String(cbSignedMessageBlob, vbNullChar)
rtn = CryptSignMessage(VarPtr(SigParams), _
False, _
1, _
MessageArray, _
MessageSizeArray, _
VarPtr(pbSignedMessageBlob), _
VarPtr(cbSignedMessageBlob) _
)
GLE = GetLastError
If rtn = False Then
err.Raise 4022, , "Failed to sign message blob: " & GLE
End If
SignMsg = True
Exit Function
erh:
SignMsg = False
End Function
Requires a good certificate context passed in, plus:
Private Declare Function CryptSignMessage Lib "Crypt32" ( _
ByVal pSignPara As Long, _
ByVal fDetachedSignature As Boolean, _
ByVal cToBeSigned As Long, _
ByRef rgpbToBeSigned() As String, _
ByRef rgcbToBeSigned() As Long, _
ByVal pbSignedBlob As Long, _
ByVal pcbSignedBlob As Long _
) As Boolean
|
|
|
|
|
Hi, Could you please share the CRYPT_SIGN_MESSAGE_PARA stru in VB6? I need it tu use the CryptSignMessage function...
Thanks.
Diego.
|
|
|
|
|
I've got a couple of .bas files containing global constants, structures and function declarations. I want to use them in VB.Net(actually in C# ). How do I do that. Apologies if i havent posted this in the right forum. Thank you very much.
|
|
|
|
|
If you want to use them in C#, you'll have to rewrite the file. Or you can try one of the online VB.NET to C# code conversion utilities. All you have to do is Google for "VB.NET C# Conversion".
|
|
|
|
|
.bas?
You mean VBA code files? Can you be more specific?
|
|
|
|