|
Hi,
I need help to draw a line graph in VB6 by using picture box. I have one senzor for light intesity and from this senzor i get Y value for my graph (in lux). X value for my diagram is a time. I need to draw 24-hour diagram of light intesity. Someting like on the link below.
http://img856.imageshack.us/i/dijagramosvjetljenja.jpg/
I dont konow how to draw x and y axes in pisture box, and how to my values (x-time, y-light intesity) plot in picture box.
Thanks
|
|
|
|
|
|
in my project, i need a lot of different formulas
so there is no standard formula and parameter
the parameter will write on textbox, the formula in richtextbox
example:
formula 1
Parameter = test1, test2 (so there are 2 parameters)
formula = test1 * test2
formula 2
Parameter = test1, test2, test3
formula = (test1 * test2) / test3
when i execute the formula
i write
strExec = "Dim formula" & vbCrLf
strExec = strExec & "Sub Main (" & parameter & ")" & vbCrLf
strExec = strExec & formula & vbCrLf
strExec = strExec & "End Sub" & vbCrLf
i use VBScript as the language
the problem is, when the run method
msScript.Run("Main", xxx)
the parameter doesn't have a standard value, i may 2 or 3 parameter
how to write in the xxx part?
i have try using array, but it return error
thanks
|
|
|
|
|
aphei wrote: how to write in the xxx part?
i have try using array, but it return error
Like this;
ref myArrayName
I are Troll
|
|
|
|
|
umm.. so, i just write msScript.Run("Main", ref strParam)?
it returns error
name ref is not declare
comma, ')', or a valid expression continuation expected.
do i need to imports anything?
thanks
|
|
|
|
|
Hi,
aphei wrote: msScript.Run("Main", ref strParam)
My apologies, accidentally posted c# syntax. Guess that would be "ByRef" in VB.NET, but I can't try it at the moment.
aphei wrote: do i need to imports anything?
Only the reference to the scriptcontrol, and I think you already have that
I are Troll
|
|
|
|
|
Our company is attempting to roll out Windows 7 (SP1) to new client boxes. There is one very large app that is causing the UAC box to pop up asking for administrative rights. Is there a utility or way to determine what section of code is triggering the UAC to popup? The application is very large and it would be nice to narrow down what area is requiring elevated rights.
Thanks for any pointers or guidance ahead of time.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
There's nothing that would cover all possiblities. Even Microsoft ACT[^] can't do it reliably. But, just in case, you'd best give it a try.
|
|
|
|
|
Hey Dave,
Saw your post Friday but forgot to reply. Yeah, I had tried ACT Friday, but didn't have much luck with it for this particular app. Thanks for the response though.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
No problem. We ran into this issue 2 year ago when we were considering moving from XP to Vista and had 1,000 apps to test. We quickly found out that there's nothing out there that can look at every app and tell you, definitively, which apps were going to work and which were going to fail, let alone how they were going to fail.
There's a few thing to look at. The first is if you're going to enable UAC and at which level.
The next is how your applications are going to react in a more restricted environment and how those problems are going to be mitigated. The results of some of this testing may affect the outcome of turning on UAC!
The third thing to look at is the installers for your apps. Depending on your deployment environment, your apps may not even install correctly.
We found a 40-50% failure rate in our installers alone. Most of those problems were easily resolved by either retiring the app if it was no longer needed, making only simple modifications to the installers, upgrading the app to a newer version, or using App-V to run the app.
|
|
|
|
|
I am creating an application were it will check installed applications(in win xp) compatibility for windows 7.
My application will run on machine running win xp and it will inform user that which installed application will have problems in windows 7 environment.
thank you.
|
|
|
|
|
Sounds useful, let us know when it's available for download.
The best things in life are not things.
|
|
|
|
|
Good luck with that! As someone heavily involved in testing 1,000 applications on Windows 7, let me tell you, no tool anyone writes is going to be able to tell you DEFINITIVELY if your applications will run on Windows 7. It's just impossible to tell until you double-click the icon and try everything out.
|
|
|
|
|
yeeh,in vb6 web activex we can call a js function like this
vb6 code
<pre>
UserControl.Parent.Script.Proc ("some msg !")
</pre>
the js function
<pre>
function Proc(msg)
{
alert(msg);
}
</pre>
it's work!
but when the js code like this
<pre>
function Proc(msg)
{
alert(document.getElementById("msg").innerHTML);
}
</pre>
it's not work! and there has an element "msg".why?
and it's error is:
run error "-2147352319(80020101) Automation error"
thnx
-- Modified Wednesday, April 20, 2011 3:31 AM
|
|
|
|
|
Here:
alert(document.getElementById("msg").innerHTML);
Remove the quotes of msg.
|
|
|
|
|
Hello,
I've written plenty of applications ran as scheduled tasks so I never had to worry about this before:
When an application is being ran as windows service: What is the best way to test when the system clock
hits a specific time (1:00am for example)? I know a timer is involved but is there a better way then
just checking at an interval because you couldn't be sure that it would hit 1:00:00 exactly, you'd have
to test a range of when it's greater then 1:00 and less then 1:01 kind of thing?
Please let me know how you do it....
Thanks,
Nathan
'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous
|
|
|
|
|
This maybe absolute overkill for your application, but I still thought I'd point you to this: Quartz.NET[^]. It can be embedded into an application and has "tons" of useful features.
Regards,
|
|
|
|
|
Thanks for the reply. Ya that's a whole lot of functionality for what I have in mind. Thanks though.
'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous
|
|
|
|
|
yep, you should treat timing values the same as floating-point values, i.e. avoid equality tests.
If your action has to happen at a specific time T, and must be executed for sure, then IMO you should test for
T <= DateTime.Now .
If the action doesn't make sense any more when a span S has elapsed, then test for
*T <= DateTime.Now) And (DateTime.Now < T.Add(S))
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Thanks for the reply. Ya I would of done it something like that. Would you choose a timer or a thread.sleep loop?
'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous
|
|
|
|
|
nlarson11 wrote: Would you choose a timer or a thread.sleep loop?
Both are doable, and my choice depends on circumstances.
Threads are more expensive than timers, yet they have automatic state: your thread waits where ever you make it wait, and it knows where it is, even if inside nested methods, loops, etc.
Warning: with a single thread or timer, you can't have two actions running at the same time, which could be good or bad, depends on requirements. With a thread or timer per action (which could be expensive, depending on their number) actions could overlap and interfere with each other.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Thanks for the input.
'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
|
|
|
|
|
You're welcome.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Get present time. Calculate period till specified time. Start a timer to "elapse" after that period. After completion of the job, start the timer again with the same logic.
|
|
|
|
|
I have a VB 6 app that I have rewritten in VB .Net from VS 2010 framework 4. The examples that I've seen from Zebra show the following
Dim SA As SECURITY_ATTRIBUTES
Dim outFile As FileStream, hPortP As IntPtr
LPTPORT = "LPT1"
Texxxt = Me.RichTextBox1.Text
hPort = CreateFile(LPTPORT, GENERIC_WRITE, FILE_SHARE_WRITE, SA, OPEN_EXISTING, 0, 0)
hPortP = New IntPtr(hPort) 'convert Integer to IntPtr
outFile = New FileStream(hPortP, FileAccess.Write, False) 'Create FileStream using Handle
Dim fileWriter As New StreamWriter(outFile)
fileWriter.Write("^XA^FO50,50^A030,30^FD ZEBRA^FS")
This gives me this
'Public Sub New(handle As System.IntPtr, access As System.IO.FileAccess)' is obsolete: 'This constructor has been deprecated. Please use new FileStream(SafeFileHandle handle, FileAccess access) instead.
When I use SafeFileHandle in XP I can print but in Win 7 I get this
{"Invalid handle.Parameter name: handle"}
Here is my code
Public Structure SECURITY_ATTRIBUTES
Private nLength As Integer
Private lpSecurityDescriptor As Integer
Private bInheritHandle As Integer
End Structure
Public Declare Function CloseHandle Lib "kernel32" Alias "CloseHandle" (ByVal hObject As Integer) As SafeFileHandle
Public Declare Function CreateFile Lib "kernel32" Alias "CreateFileA" ( _
ByVal lpFileName As String, _
ByVal dwDesiredAccess As Integer, _
ByVal dwShareMode As Integer, _
<marshalas(unmanagedtype.struct)> ByRef lpSecurityAttributes As SECURITY_ATTRIBUTES, _
ByVal dwCreationDisposition As Integer, _
ByVal dwFlagsAndAttributes As Integer, _
ByVal hTemplateFile As IntPtr) As SafeFileHandle
Dim COMPORT As String
Dim hPort As SafeFileHandle
Dim SA As SECURITY_ATTRIBUTES
Dim outFile As FileStream
COMPORT = "COM4"
hPort = CreateFile(COMPORT, GENERIC_WRITE, FILE_SHARE_WRITE, SA, OPEN_EXISTING, 0, 0)
outFile = New FileStream(hPort, FileAccess.Write, 8, False)
Dim fileWriter As New StreamWriter(outFile)
fileWriter.Write("^XA") ' Start format
the invalid handle is hPort. Does anyone have an answer and how to correct? TIA
Ed Mee
|
|
|
|
|