Finding the path to file using application startuppath in a windows form - windows

Hi every one I am trying to access a file in certain folder in my windows form app, but I keep getting the error "could not find a part of the path: C:....e.t.c".
here is my code:
string doc = Application.StartupPath + #"\filefolder\pin-card02.docx";
please what is wrong with this piece of code?
I have seen some explanations but nothing tells me how to direct my program to a certain file in a folder...
Thanks in Advance

There's probably nothing wrong with this piece of code, most likely this file is not set as content of your application and is not getting copied to the output directory, if this is part of a visual studio solution, check that pin-card02.docx has "copy to output directory" set to "Always" or "Copy if newer" in the .doc's properties, if it's not part of the solution, you may need to include it and set the property.
If this doesn't help, you'll need to provide more information on the problem.

Related

Can't launch debugger for Visual Studio Extension

I'm using this LinkedIn learning course https://www.linkedin.com/learning/visual-studio-code-building-an-extension/scaffolding-an-extension?u=67553434 to create an Extension. I'm creating a theme currently, so its a .json file
The course tells me to launch the debugger, but I keep getting an error saying "Cannot launch program (file path); setting the 'outFiles' attribute might help. Any idea what this means? is my file path correct?
I'm sure i'm doing something silly, so would appreciate any quick help to get me going. Thanks!

My OpenShift custom auto scaler haproxy_ctld only logs "no such file or directory"

On an openshift PHP5.4 cartridge with embedded haproxy, I followed the tuturial for putting a custom auto scaling algorithm in place. After I push my (executable) haproxy_ctld.rb code, it tells me to have restarted the haproxy_ctld successfully, however when I go via ssh to the shell of my app and type a command to the deamon it gives one or many (depending on the flags) times the message ": No such file or directory". When I look in the log file of haproxy_ctld it also only contains some entries of ": No such file or directory".
I did not change anything about the code. Only thing changes is that the file from over here is added as executable to the .openshift/action_hooks directory.
I also tried adding an info-logging statement as the first statement of each method in the file, to get a grip on what is happening. I would expect such log messages to appear in the log file e.g. after typing "haproxy_ctld -u" it should give me one of my added info-log messages, but no.
When removing the haproxy_ctld.rb file, typing haproxy_ctld --help gives me the help text like it should.
I ran out of ideas. Who has ANY idea what to do next, please help me? Thanks!
Turns out after creating a new app and following the tutorial all is well. Maybe the first time I skipped / overlooked the step of restarting the entire app as mentioned in the tutorial.

Has anybody using core-plot seen the following error "'CPTAnimation.h' file not found"

Trying to create the minimal core-plot project - http://www.mobdevel.com/?p=96
I've installed core-plot as a static library.
When I try to run the program I get the following error
CorePlot-CocoaTouch.h:4:9: 'CPTAnimation.h' file not found
When I move it "up" I get the error with the next file "below" 'CPTAnimationOperation.h' file not found
header search path is correct I believe ../core-plot/framework
( source is just beneath it)
I'm sure it's something dumb
There is an other solution is to add the header search path /core-plot-master/framework then select recursive, this worked for me.
needed to be ../core-plot-master/framework/Source
Had originally stopped at framework because adding /Source gave error of CPTPlatformSpecificDefines.h not found
so I had to add additional search path of ../core-plot-master/framework/iPhoneOnly as well

Method or data member not found compile issue

I have a VB6 project that I didn't create but I have to update, when I go to make the exe I get a compile error: Method or data member not found, and it points too "SCom1.FileReceive" in the code below. When I look at the Main form, the SCom1 control is a PictureBox.
This code has been working for the last 5 years but I don't know why SCom1 is a picturebox, or why I'm getting the error, is it a reference? SCom1 to me looks like a MSComm function? Let me know if anyone has any ideas, I just don't know VB enough to know how to troubleshoot this. Thanks
If SCom1.FileReceive = True Then
WriteToLog (Now() & " FileReceive was true, now false")
SCom1.FileReceive = False
End If
The machine which you have opened the code doesn't have the mscomm32.ocx file or the ocx file not registered properly.
When vb cannot reference an ocx, it'll convert the relevant control to a picture box control.
What you have to do is, close the project without saving. Then open system32 folder and check for mscomm32.ocx file. If the file is not there then you have to download that from the intenet. The register the file using regsvr32 command in command prompt.
After this you can open the vb6 project and start working.
=========================================================
EDIT : Included the update in the comments to the answer, this will help other users in the future... :-)
if the method name doesn't look familiar to a known ocx file (in this case the SCom1.FileReceive), the missing component can be a custom ocx file.
So check on the working machine or in project folder whether there are any ocx file exists in the relevant name (in this case SCom.ocx).
if there is a file exists in such name, register that file using regsvr32 (if not registered), then add that to toolbox, then replace the picture box control with the relevant control (make sure the name tally).

Adding LESS Extension to Dreamweaver CS5.5

Work gave me a new Macbook Pro yesterday and I'm having a hard time getting Dreamweaver CS5.5 to work with my LESS files. At first, I was getting an error saying that it couldn't open the filetype, so I hit the Adobe help areas and user forums and found the solution about editing Extensions.txt and MMDocumentTypes.xml. So now I can open the files from my local files side panel, but not from File -> Open. And despite having it listed as a Style Sheet extension, code hinting and coloring isn't working. A bizarre twist is that now if I take out my edits to those files, DW still opens the LESS files without an error. Anyone have any ideas how I can get this fully operational?
Here are a couple of the articles I found in my research and followed as best I could:
http://help.adobe.com/en_US/dreamweaver/cs/extend/WS5b3ccc516d4fbf351e63e3d117f53d6108-7fda.html
http://helpx.adobe.com/dreamweaver/kb/change-add-recognized-file-extensions.html
From what I tried today, it kind of makes sense to me now. I have it working on CS5. To get started, you should show all files on your computer. Spotlight (OS X) makes things super easy to find all instances of those files. Once you find it, CMD + R will reveal the parent folder where the file resides.
The "Extensions.txt" handles whether or not DW can open the file from the modal window/program menu. This file is located in 2 places and you should edit using "text edit" or another baside editing program:
USERS/library/Application Support/Adobe/Deamweaver
CS5/en_US/Configuration/Extensions.txt
Applications/Dreamweaver/Configuration/Extensions.txt
To do that you just need to declare a new type:
As part of the "all documents" list you need to add your SCSS,LESS
extensions
As part of the "stylesheets" list you need to add your SCSS,LESS extensions
CSS,SCSS,LESS:Style Sheets
The second file you need to EDIT, is under the folder "DocumentTypes" in CS6 I believe that folder has moved to:
USERS/library/Application Support/Adobe/Deamweaver CS5/en_US/Configuration/
However, in CS5, I found this folder in Applications/Dreamweaver/Configuration/
From here if you edit "MMDocumentTypes.xml" this file it should explain how those extensions you previously defined in "Extensions.txt" should behave. (Again, use a basic text editor).
I think somewhere on line 140 or so, you'll see the following:
<documenttype id="CSS" internaltype="Text" winfileextension="css" macfileextension="css" file="Default.css" writebyteordermark="false" mimetype="text/css" >
From here add "scss,less" to the 'winfileextension' and 'macfileextension'. Because you're on a Mac, you probably want to make sure its filled out in the 'macfileextension' attribute.
The result should look like this:
<documenttype id="CSS" internaltype="Text" winfileextension="css,scss,less" macfileextension="css,scss,less" file="Default.css" writebyteordermark="false" mimetype="text/css" >
Cheers!

Resources