|
Jon_Boy wrote: Is it possible to copy a file to a destination that includes a shortcut link in the path?
No, since the .lnk is a file, not a virtual path. The file-system treats it as a file, not as a NTFS Junction Point[^].
As an alternative, you can use VB.NET to read what the .lnk file is pointing to, and concatenate that to your path. You'd need to import a COM-library called "Windows Script Host Object Model", then you could run code similar to this;
Imports IWshRuntimeLibrary
Module ShortcutExample
Sub Main
Dim MyWshShell = new WshShell()
Dim MyShortcut = MyWshShell.CreateShortcut("C:\Users\Eddy\Desktop\SomeFolder.lnk")
Console.WriteLine(MyShortcut.TargetPath)
Console.ReadKey()
End Sub
End Module
Happy Programming
Bastard Programmer from Hell
|
|
|
|
|
Sounds like a plan. Thanks!
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
You're welcome
|
|
|
|
|
Hello.
I am using VB 2010 under Windows XP to create a MDI Windows Form
application. Question : is it possible to change the color or the title bar
and of the border of the children forms, form by form ?
modified on Monday, July 18, 2011 7:27 AM
|
|
|
|
|
Only if you draw the ENTIRE form yourself. What you're doing is drawing whats called the "non-client" area. This means you'll have to override the WndProc method and handle, at a minimum, the WM_NCPAINT message. This tells your code to paint its non-client area. The form properties won't do you much good here are they only specify the client area dimensions and settings.
Docs on the WM_NCPAINT message[^].
|
|
|
|
|
|
Sure. Most will allow you to change the form borders. How you do that depends on the library you chose.
|
|
|
|
|
I posted this in quick questions but didn't get any satisfactory response. I'm new here and don't know if it's possible to move my question here so I guess I'm guilty of cross posting. Admin - If you delete, could you delete my other post rather than this one please? Anyway - to my question.
Attempting to read from serail port, XP, admin accnt.
if there are chars in the buffer, then the following throws error: Permission denied, code: 800A0046 on the check of AtEndOfStream.
forRead=1
Set fso = CreateObject("Scripting.FileSystemObject")
Set comObj = fso.OpenTextFile("COM3:9600,N,8,1", for Read)
if not comObj.AtEndOfStream then
msgbox comObj.ReadLine
end if
com.Close
Writing on the other hand works just fine with the following:
forWrite=2
Set fso = CreateObject("Scripting.FileSystemObject")
Set com = fso.OpenTextFile("COM4:9600,N,8,1", forWrite)
com.Write "Hello World"
com.Close
Not sure its relevant but I'm using com0com to connect the two ports (3 & 4)
I should perhaps also add that using the MSCOMM obj in VB6 I can read and write no problem.
Any ideas why the permission denied for the read.
Thanks
modified on Saturday, July 16, 2011 5:42 AM
|
|
|
|
|
Don't cross post. You didn't wait long enough before posting this question yet again.
|
|
|
|
|
Hi Dave - A thousand apologies. I did try to explain that I felt I'd probably posted in the wrong place first. If I could live my life over I'd have posted it here first. I'll hopefully live and learn and try to become a better person (but being the wrong side of 50 I fear it may be too late for me). Please feel free to delete my first post or my second post or both whichever you feel is for the best.
|
|
|
|
|
Can't figure out how to code web browser with advanced tabs. And suggestion?
|
|
|
|
|
What have you tried so far? Where are you stuck?
|
|
|
|
|
I have tried using ToolStrip, but can't seem to get the coding right.
|
|
|
|
|
Well, no one can help you if you are not specific about your problem.
|
|
|
|
|
Nevermind. I found my problem. (: sorry for bothering you.
|
|
|
|
|
That's okay. Care to share your problem and your solution? It might be helpful to others.
|
|
|
|
|
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' ACD CHEMBASIC DEMO PROGRAM '
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' '
' Molecular 3D Editor//MIRROR.BAS '
' '
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' '
' The utility flips the molecule at a plane '
' '
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
CONST TITLE="ChemBasic Molecular Editor // Mirror"
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Function Main As String
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' MIRROR.BAS '
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim page,diag,asm,struc As Object, s As String, OK As Boolean
MAIN="Failed or nothing to do!"
' Get 1st structure from the curent page
page=ActiveDocument.ActivePage
If page.Diagrams.Count<1 Then Exit Function
diag=page.Diagrams.Item(1)
asm=Assemblies.AddFromCS(diag)
If asm=NULL Then Exit Function
struc=Asm.Structures.Item(1)
If struc=NULL Then Exit Function
' Do the job
s=UserIOBox("Flip X, Y, or Z coordinate ?" ,TITLE , "Y")
s=UCase(Left(s,1))
If s="X" OR s="Y" OR s="Z" Then
' Flip !
Call Flip(struc,s)
' Show the results
RefreshDiagram(diag,struc)
Main="Completed."
End If
End Function
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub Flip(struc As Object,s As String)
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim x,y,z As Double, asm,at As Object
With struc
asm=.Assembly
For Each at In asm
.GetAtomXYZ(at,x,y,z)
Select Case s
Case "X"
x=-x
Case "Y"
y=-y
Case "Z"
z=-z
End Select
.SetAtomXYZ(at,x,y,z)
Next at
End With
End Sub
'***LIBRARY PROCEDURES BEGIN
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub RefreshDiagram(diag As Object,strmol As Object)
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' LIB0.BAS PROCEDURE '
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Redraws the diagram with a molecule or structure object '
' '
' ENTER '
' diag object of type CS_DIAGRAM '
' strmol object of type CB_MOLECULE or CB_STRUCTURE '
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim l,t,w,h,w1,h1 As Integer
diag.GetBound(l,t,w,h)
diag.Depict(strmol)
diag.GetBound(w,h,w1,h1)
diag.SetBound(l,t,w1,h1)
End Sub
'***LIBRARY PROCEDURES END
'@@@@@@
someone can help me with this code?!?!?
|
|
|
|
|
OK,
So you've found some code on the internet and posted it here but you haven't asked a specific question describing what it is that you want.
Alan.
|
|
|
|
|
What problem are you having with the code? Can you describe an error message? A few hints would be nice.
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
i understand the code but i want develop a chemistry program
|
|
|
|
|
So, do you have a design, specifications, or some idea of what the program should do?
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
in this moment no i hope in your help
|
|
|
|
|
Because we have no clue about your question. Please give us complete details. BTW put your code in Code block in your question which is easy to read.
|
|
|
|
|
Well, if you don't know what the program is supposed to do, I don't think I can figure it out. Let us know what you want it to do and then maybe someone can help figure out how to do it.
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
i hope that someone can help me
|
|
|
|
|