|
Do you know how should i create a safearray in VB?
rechi
|
|
|
|
|
Dim vx As Variant
Dim v(2) As String
v(0) = "First Argument"
v(1) = "First Argument"
vx = v
It is Illogical to define an inventor by his invention
|
|
|
|
|
Hello,
I need my project to expire after 30 days of use. How can I do this?
If you dont have the code just tell me the process to make it a trial one then I'll research a little more.
Thanks in advance
adol
|
|
|
|
|
Would your app. connect to the internet?
Cheers,
Simon
"Every good work of software starts by scratching a developer's personal itch.", Eric S. Raymond
|
|
|
|
|
My app would not connect to the internet.
adol
|
|
|
|
|
There are several ways to do this, however one of the simpilest ways is to store a value in the registry (i.e. - installation date) and then when the application loads everytime you can grabb that value from the registry and check using DateDiff to see if time has expired. There is a lot of code out there explaining how to use the registry in your application so I won't go into the details, but again this is just a suggestion.
HTH
Nick Parker
|
|
|
|
|
Thank you very much for your help Nick!!!
Maybe this is the easiest way to do it.
Somebody told me I can use the Hard Disk serial number or something like that to control the use of an app, does anybody knows what he was talking about?
Best regards,
adol
|
|
|
|
|
I would strongly reccomend encrypting or hiding the date if it is in the registry even if you only do somthing simple like XORing the value. Otherwise, it's realy easy to modify the registry entry to make the program work forever. If you need more explanation, just reply.
|
|
|
|
|
I was only giving an example of a method to limit application life, there are of course other ways (i.e. - including encryption) that are better.
Nick Parker
|
|
|
|
|
This question is really a question of why not how.
I was playing around with an application that would hide and display the cursor with the Win API ShowCursor . I was calling this function in the load event of the application and it was not working. I had a timer on the form and decided to call the ShowCursor function there. Even though this is repetative it works. Does anyone have any ideas what would cause this?
Nick Parker
|
|
|
|
|
Because its param isn't a boolean to just toggle the cursor on and off.
From MSDN about the param...
Specifies whether the internal display counter is to be incremented or decremented. If bShow is TRUE, the display count is incremented by one. If bShow is FALSE, the display count is decremented by one.
So, ShowCursor False isn't guaranteed to hide the cursor. If another application passed it True a couple of times it won't hide it. If the internal counter is 0 or greater the cursor will remain visible and it hides if it's -1, so check the return value of ShowCursor() and keep on calling it until the counter is -1.
That's why the timer method worked. It ensured the internal counter was -1 by calling it over and over again. The thing is though, once it's hidden you can stop calling ShowCursor() to avoid wasting CPU cycles.
Jeremy L. Falcon<nobr>
Homepage : Sonork = 100.16311
"It was a blind man who taught me how to see." - Aerosmith
|
|
|
|
|
Thanks for the response Jeremy, I figured that out about 30 minutes later during lunch . This was just something that I was playing around with so no worries.
Nick Parker
|
|
|
|
|
Nick Parker wrote:
I figured that out about 30 minutes later during lunch
Funny ain't it? It's usually the same way with me. When I get away from the computer is when the solution just pops in my head. Oh well, at least it gave me an excuse to visit the VB forum again.
Jeremy L. Falcon<nobr>
Homepage : Sonork = 100.16311
"It was a blind man who taught me how to see." - Aerosmith
|
|
|
|
|
Same here, I had been hanging my head in the C# forum for quite a while.
Nick Parker
|
|
|
|
|
My Word macro has grown HUGE, so I want to convert it to some C or C++ console application, or whathever, so that It can run i Background.
Is possible to make an exe out of a Macro, convert the VBA and make and compile it, etc.
This macro simply makes some standard modifies to a TEXT file.
The problem is that the Macro language i think VBA, has some advanced funcions to move the cursor in the text.
Like Selection.
.MoveDown Unit:=wdLine, Count:=1, Extend:=wdExtend
.HomeKey
.TypeText Text:=hello
.TypeParagraph
.TypeBackspace
.Delete Unit:=wdCharacter, Count:=3
"Nelle cose del mondo non e' il sapere ma il volere che puo'."
|
|
|
|
|
Ofcourse, you can cut and paste the code in a VB module and compilet it. Of course you may need to add the appropriate reference and also make some small corrections.
|
|
|
|
|
I dont know much about VB.
My code is something like:
Selection.MoveUp Unit:=wdLine, Count:=1
Selection.HomeKey Unit:=wdLine
Selection.MoveRight Unit:=wdCharacter, Count:=87
Selection.Delete Unit:=wdCharacter, Count:=6
Selection.PasteAndFormat (wdPasteDefault)
Selection.TypeBackspace
Selection.TypeBackspace
Selection.TypeBackspace
Selection.MoveLeft Unit:=wdWord, Count:=1
Selection.TypeBackspace
Selection.MoveRight Unit:=wdWord, Count:=8
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.PasteAndFormat (wdPasteDefault)
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.MoveLeft Unit:=wdCharacter, Count:=2
Selection.MoveLeft Unit:=wdWord, Count:=2, Extend:=wdExtend
Selection.TypeText Text:="="
And I copied it into the sub main of module one in a new Visual Basic Console application.
But everithing don't work.
Selection wdCharacter,wdExtend, wdLine, is undeclared, etc etc etc
HELP PLEASE!
"Nelle cose del mondo non e' il sapere ma il volere che puo'."
|
|
|
|
|
Selection seems to be a Word Library Object.
Should I import the Word Library to my project for make my code working again?
"Nelle cose del mondo non e' il sapere ma il volere che puo'."
|
|
|
|
|
Define Global objects like this
Dim Selection as Word.Selection
Dim WordApplication as New Word.Application
Sub Form_Load
set Selection = WordApplication.Selection
End Sub
|
|
|
|
|
Rama Krishna wrote:
Dim Selection as Word.Selection
Dim WordApplication as New Word.Application
It looks like "TYPE WORD NOT DEFINED" ????
"Nelle cose del mondo non e' il sapere ma il volere che puo'."
|
|
|
|
|
I am getting a permission denied error when copying text from inside a temp text file to a file already set up in another folder. The problem only occurs when I am reading a group of files and the last file is the one that fails.
|
|
|
|
|
Two things:
1. Are you closing the file after you are done with each one?
2. Have you checked the file permissions to see that you have access to it?
Nick Parker
|
|
|
|
|
Cuold you be more specific , exactly what is the scenario ?;P
|
|
|
|
|
Dose anyone know how to use the SVGControl.dll in VB6 to view .pdf files. Where can I find any code examples
Thanks
|
|
|
|
|
I found the answer to this one on my own thanks. The SVGControl is for viewing SGV files only. When you try to view a .pdf file no error message is given, only nothing shows on the screen.
|
|
|
|