|
Hi,
vmars316 wrote: but all i get back is a "0", telling me that all is well.
On the contrary 0 or null is telling you that all is not well. What arguments did you supply to the function. A short code fragment showing the context of the call would be helpful.
Alan.
|
|
|
|
|
Straight from the documentation:
"If the function fails, the return value is NULL. To get extended error information, call GetLastError."
Luc Pattyn [Forum Guidelines] [My Articles]
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
modified on Sunday, November 22, 2009 3:16 PM
|
|
|
|
|
Hello!
I have to produce a software license number from a PDA's device ID. Whenever a user submits this ID to web site, the new licence number must be produced according to submitted id and then whenever user uses the new license number in the software, the code should resolve the new id according to PDA's device id and confirms it.
For example:
The following is a PDA's device ID (7AAF5100226808010d19-c37ad75c0345) and the new license number should be likely this
(5FC6-88J9-1264-76K8)
How can I produce such algorithm. Is there a code sample? I need a road map to realize the concept.
Thank You.
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
Use simple hashes based using secret company and product hashes as salts and then combine them all to generate a license hash.
|
|
|
|
|
How about Reversing the produced license key and finding the product of the secret company. Hascode only produces numeric numbers.
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
Yes but you could then tweak the generated hash to ensure that the generate key is within the ascii printable charachter set.....
|
|
|
|
|
Hello,
my aim is to insert a table with 100 rows and 2 cols at the end of a document.
Next I have to fill every row with a random font-name in the first column and a formatted text with that random font in the second column.
A font-type must not be repeated within the next 10 rows.
So here is a code, that does exactly that thing, but I want to find a more performant solution - maybe someone could help me how to optimize it. I know that there are much better ways how to solve this problem, thats why I ask.
Thanks in advance for taking the time,
cherry
'Set Range to end of document
Dim where As Range
Set where = ActiveDocument.Range(ActiveDocument.Range.End - 1, ActiveDocument.Range.End - 1)
'Insert table with 100 rows and 2 cols
Set tablewith_different_styles = ActiveDocument.Tables.Add(where, 100, 2, _
DefaultTableBehavior:=wdWord9TableBehavior, AutoFitBehavior:=wdAutoFitFixed)
'Loop 100 times for each Font
i = 0
g = 1
Do While i < 5
Do While g < 21
'Got to table row i, col 1
tablewith_different_styles.Cell((i * 20) + g, 1).Select
'Set random font
Selection.Font.Name = FontNames(g + 20)
'Save random font
Name_Font = Selection.Font.Name
'reset font for next output
Selection.Font.Name = "Courier New"
Selection.Font.Size = 9
'Insert font name and iterate to next line
Selection.TypeText Text:=Name_Font
Selection.MoveRight Unit:=wdCell
'set font and size
Selection.Font.Name = FontNames(g)
Selection.Font.Size = 9
Selection.TypeText Text:="My Formatted Text in every Row."
g = g + 1
Loop
g = 1
i = i + 1
Loop
|
|
|
|
|
This looks pretty simple and efficient to me. The only other approach that might make this process faster is by going through XML. Maybe code creating the word file in xml format (but saving it as word) might execute faster.
My advice is free, and you may get what you paid for.
|
|
|
|
|
Thanks for your answer. But it is not what I'm looking for.
The problem is: I know this works usually much faster - the table gets inserted and filled in less than 2 seconds - there has to be another way and sadly I'm totally new to VB.
I would be happy if someone had another tweak for me...
Thx cherry
|
|
|
|
|
You said, you know that it usually works faster. It might help, if you could explain how you used to do it. What changed?
My advice is free, and you may get what you paid for.
|
|
|
|
|
Oh, if it would have been me who worked it faster, then I maybe wouldnt ask you
Its kind of a challenge, the fastest makro wins. It not only this table, but this table
is the part that costs me the most computation time.
I only know, that it would eventually be faster, if you set up the table step by step. But I don't know how to do it best and I don't think of this as a great idea.
So far, thanks. cherry
|
|
|
|
|
I am not sure if something is getting lost in translation. Do I understand you correctly, the code you posted is written in MS Word's own code editor (i.e. it is VBA), or has it been written in VB.NET using Office.Interop?
My advice is free, and you may get what you paid for.
|
|
|
|
|
Hi all,
I want to read and write the additional informations you can set to a image about windows explorer
(right klick on image -> propertys -> fileinfo).
[]
How can I do this in VB.Net?
I try the EXIF-Data of an image, but there I can't find these informations.
Thanks all for help
|
|
|
|
|
You should probably look into System.IO, System.Drawing and the Image class.
My advice is free, and you may get what you paid for.
|
|
|
|
|
Hi all,
in System.IO.Drawing.Imaging I only found the PropertyItems.
But in the PropertyItems I can't find the Attributes I wan't to use.
Screen
By GoogleSearch I find out, that these informations are stored in ADS (Alternate Data Stream).
Has anybody a solution for reading, writing and searching these data?
Thanks all
|
|
|
|
|
|
Hi Johan,
that's not really helpfull, cause it's an old VB6 code.
Thanks for help
|
|
|
|
|
|
Hi Johan,
that's only for reading.
By using Google I found this one:
ADS
I think this is the solution I need.
Thank you very mouch for help
best regards
Maik
|
|
|
|
|
i am getting some trouble with a tutorial that i found on msdn web site : http://msdn.microsoft.com/en-us/library/ms227722.aspx.
i would like to pass a parameter to my CrystalReport document,but i would like to send an integer value to my CR document and just one value(because in the tut its sending and array of string values).
the code is the fellowing
Private Const PARAMETER_FIELD_NAME As String = "numb"
Private impbonrecepReport As ReportDocument
Private Sub ConfigureCrystalReports()
Dim myArrayList As ArrayList = New ArrayList()
myArrayList.Add(999)
Dim numbrecep As Integer
numbrecep = 999
SetCurrentValuesForParameterField(impbonrecepReport, myArrayList)
impbonrecepReport = New ReportDocument()
Dim reportPath As String = Application.StartupPath & "\" & "ImpBonReception.rpt"
impbonrecepReport.Load(reportPath)
CrystalReportViewer1.ReportSource = impbonrecepReport
End Sub
Private Sub SetCurrentValuesForParameterField(ByVal myReportDocument As ReportDocument, ByVal myArrayList As ArrayList)
Dim currentParameterValues As ParameterValues = New ParameterValues()
For Each submittedValue As Object In myArrayList
<big>Dim myParameterDiscreteValue As ParameterDiscreteValue = New ParameterDiscreteValue()</big>
myParameterDiscreteValue.Value = myArrayList.ToString()
currentParameterValues.Add(myParameterDiscreteValue)
Next
Dim myParameterFieldDefinitions As ParameterFieldDefinitions = myReportDocument.DataDefinition.ParameterFields
Dim myParameterFieldDefinition As ParameterFieldDefinition = myParameterFieldDefinitions(PARAMETER_FIELD_NAME)
myParameterFieldDefinition.ApplyCurrentValues(currentParameterValues)
End Sub
i got this error message
An unhandled exception of type 'System.NullReferenceException' occurred in GestionStock.exe
Additional information: La référence d'objet n'est pas définie à une instance d'un objet.
in this line
Dim myParameterFieldDefinitions As ParameterFieldDefinitions = myReportDocument.DataDefinition.ParameterFields<br />
can you help me to solve this problem? thank you
ps: i am on VS2005 VB.NET
|
|
|
|
|
Move the call to SetCurrentValuesForParameterField to the line after loading the report. This should fix your problem.
Tosch
|
|
|
|
|
now i getting a message error in the next line
Dim myParameterFieldDefinition As ParameterFieldDefinition = myParameterFieldDefinitions(PARAMETER_FIELD_NAME)
this is the error message
An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in CrystalDecisions.CrystalReports.Engine.dll<br />
<br />
Additional information: Index non valide. (Exception de HRESULT : 0x8002000B (DISP_E_BADINDEX))
|
|
|
|
|
You're trying to get an item with the name PARAMETER_FIELD_NAME from your myParameterFieldDefinitions. Does it exist in the collection? Probably not, as the error says 'Index not valid'
Tosch
|
|
|
|
|
i fellowed the first part of this tutorial to set myParameterFieldDefinitions : LINK TO THE TUT
and i have in my table(the table linked o the crystalReport Document) field called numb that i assigned it to PARAMETER_FIELD_NAME .
and still dont know where is the error ???
|
|
|
|
|
Please loop through myParameterFieldDefinitions and check if any member is called numb (your fieldname). I'm not sure what the propertyname is, probably name or fieldname.
Tosch
|
|
|
|