|
Hello,
I've been trying to make a program that can basically return the contents of an image to paint via the File/Open dialog.
So you'd open Paint, hit file-->Open and then either
1. Select my program which returns an image somehow or
2. Select my file type which does something else! (What I don't know!)
What I'd like to do is have a shortcut type program that pulls files from a database rather than the filesystem.
Maybe I should be asking how do .lnk files tell paint to get the file from somewhere else?
Any ideas?
Thanks
Gareth
|
|
|
|
|
The .lnk file is a special Explorer hack that "acts" like the soft link in a Unix-like system. It's all done in the shell, so access to it is a little secretive, if possible at all. I don't think that you can get there from here.
I have seen shell add-ins, though, that look like they're a part of the file system as accessed through the Explorer, but actually connect to "other stuff." You might want to see if something like shell extension handlers[^] would work for you.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
I've just come over something called a re-parse point! It sounds like something I could use!! Has anyone had any experience with these?
http://www.pcguide.com/ref/hdd/file/ntfs/filesReparse-c.html[^]
Quote: (From link)
In addition to allowing reparse points to implement many types of custom capabilities, Microsoft itself uses them to implement several features within Windows 2000 itself, including the following:
Symbolic Links: Symbolic linking allows you to create a pointer from one area of the directory structure to the actual location of the file elsewhere in the structure. NTFS does not implement "true" symbolic file linking as exists within UNIX file systems, but the functionality can be simulated by using reparse points. In essence, a symbolic link is a reparse point that redirect access from one file to another file.
Junction Points: A junction point is similar to a symbolic link, but instead of redirecting access from one file to another, it redirects access from one directory to another.
Volume Mount Points: A volume mount point is like a symbolic link or junction point, but taken to the next level: it is used to create dynamic access to entire disk volumes. For example, you can create volume mount points for removable hard disks or other storage media, or even use this feature to allow several different partitions (C:, D:, E: and so on) to appear to the user as if they were all in one logical volume. Windows 2000 can use this capability to break the traditional limit of 26 drive letters--using volume mount points, you can access volumes without the need for a drive letter for the volume. This is useful for large CD-ROM servers that would otherwise require a separate letter for each disk (and would also require the user to keep track of all these drive letters!)
Remote Storage Server (RSS): This feature of Windows 2000 uses a set of rules to determine when to move infrequently used files on an NTFS volume to archive storage (such as CD-RW or tape). When it moves a file to "offline" or "near offline" storage in this manner, RSS leaves behind reparse points that contain the instructions necessary to access the archived files, if they are needed in the future.
Thanks
Gareth
|
|
|
|
|
Gareth,
If you get anywhere with this solution, please drop a line here on the message board. I'd be intrigued to see what happens.
Thanks.
Curtis.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
Gareth,
You can also invoke ClipBoard and exchnage the image in Paint recognizable format.
Which programming language are you using?
Is'nt it?
Vasudevan Deepak Kumar
Personal Web: <a href="http://www.lavanyadeepak.tk/">http://www.lavanyadeepak.tk/</a>
I Blog At:
<a href="http://www.dotnetjunkies.com/weblog/deepak/">http://www.dotnetjunkies.com/weblog/deepak/</a><br><a href="http://deepakvasudevan.blogspot.com/">http://deepakvasudevan.blogspot.com/</a><br> <a href="http://deepak.blogdrive.com/">http://deepak.blogdrive.com/</a>
|
|
|
|
|
Hi,
Thanks for the idea but I'd like to do this will any registered file format! Not just images (I used that as an example).
I have a program that's associated with a file format. When you double click the file from Windows explorer it loads the file from a database using the associated program (eg word for .doc, excel for .xls etc etc)
I'm using C#
Thanks
|
|
|
|
|
Hello everyone, my name is kenny, Im kinda new to the codeproject.com scene and somewhat to the .NET framework scene. Anyways, Im going to start making video tutorials, and i wanted some feedback on where i should start, (basics -> advanced), requests only, etc...
|
|
|
|
|
Dear member,
you can visit www.learnvisualstudio.net for informative video tutorials on visual studio 2005
It is a very helpful site for learning c#. You may also download the following for microsoft.com
visual C# 2005 ExpressEdition with MSDN and SQL Server 2005 Express Edition
Wish you all the best
Renjith
|
|
|
|
|
if i program an use variable in java script, how can i "work" with it in the C# source?
is it with Document?
HHHHHHHHHEEEEEEELLLLLLLLLPPPPPPPPP.
Thanks
e.g.: i want to work with the xmlhttp.responsetext???
function MyFunc()
{
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.Open("GET","http://www.msn.com",false);
xmlhttp.Send();
alert(xmlhttp.responsetext);
}
|
|
|
|
|
The JavaScript code to which you refer runs in a client's browser. The C# code to which you refer runs on a Web or application server. In this scenario, the two don't exist together in the same process space and can, therefore, not "share" variables.
You can only "share" values through serializing between the two processes, usually through HTTP requests.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
So you mean that i can not use the text that i got from the activeXobject, so how can i get the source code of a site, i mean the html source and work with it in the server side?
Thanks
|
|
|
|
|
I don't mean to appear obtuse, but I'm a tad confused about your goal. Could you give me another example of what you'd like to do?
If you're just trying to use the XMLHTTP object in IE, then you can read Using Microsoft's XMLHTTP Object to Get Data From Other Web Pages[^].
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
I'm having an issue in an Excel project I'm doing with VSTO.
Buttons that are not initially displayed when the page is loaded, do not become "active" when they are scrolled to. They look slightly fuzzy and bolded, but do not "click," they just sit there. There is a lot of stuff going on in the VSTO document(calls to a db to save/fill data, dynamic calculation, etc), and I think this might be causing my issue
To see what I'm talking about(slightly), create a new vsto project and paste this into sheet1
<br />
private void Sheet1_Startup(object sender, System.EventArgs e)<br />
{<br />
Globals.ThisWorkbook.Application.DisplayAlerts = false;<br />
string name;<br />
for (Char x = 'A'; x <= 'Z'; x++)<br />
{<br />
name = "Button" + x.ToString();<br />
Controls.AddButton(this.Range[String.Format("{0}1", x), missing], name);<br />
Button b = (Button)this.Controls[name];<br />
b.Click += new EventHandler(b_Click);<br />
b.Text = name;<br />
}<br />
<br />
}<br />
<br />
void b_Click(object sender, EventArgs e)<br />
{<br />
Button B = sender as Button;<br />
Random r = new Random();<br />
String bStr = B.Text.Substring(6);<br />
for (int iii = 2; iii < 200; iii++)<br />
{<br />
this.Range[String.Format("{0}{1}", bStr, iii.ToString()), missing].Value2 = r.Next(100);<br />
}<br />
}<br />
Anywho, what this does is put a large row of buttons across the top of a screen, and when pressed, populates a lot of data below it(random numbers, hopefully to simulate(in a way) the load my program creates). once there is a lot of data, try scrolling down and up and notice that as the buttons come on screen, they are briefly "fuzzy" before they turn normal.
Has anyone encountered this before and know why this "refresh" might be suppressed?
|
|
|
|
|
hi all,i'm creating a mobile appliction with ms vs2005 release edition, im using a webservice from www.webservicex.com and i get the exception with the details :
Status :System.Net.WebExceptionStatus.ConnectFailure
System.Net.WebException was unhandled
Message="Could not establish connection to network."
StackTrace:
at System.Net.HttpWebRequest.finishGetResponse()
at System.Net.HttpWebRequest.GetResponse()
at System.Web.Services.Protocols.WebClientProtocol.GetWebResponse()
at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse()
at System.Web.Services.Protocols.SoapHttpClientProtocol.doInvoke()
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke()
at DeviceApplication2.net.webservicex.www.lengthUnit.ChangeLengthUnit()
at DeviceApplication2.Form1.button1_Click()
at System.Windows.Forms.Control.onclick()
at System.Windows.Forms.Button.onclick()
at System.Windows.Forms.ButtonBase.WnProc()
at System.Windows.Forms.Control._InternalWnProc()
at Microsoft.AGL.Forms.EVL.EnterMainLoop()
at System.Windows.Forms.Application.Run()
at DeviceApplication2.Program.Main()
&here's my code:
private void button1_Click(object sender, EventArgs e)
{
net.webservicex.www.lengthUnit l = new
DeviceApplication2.net.webservicex.www.lengthUnit();
double x = l.ChangeLengthUnit(120, DeviceApplication2.net.webservicex.www.Lengths.Feet, DeviceApplication2.net.webservicex.www.Lengths.Meters);
MessageBox.Show(x.ToString());
}
please tell me where is the error (i'm deploying it using the device emulator and the active sync program)
|
|
|
|
|
|
I have written a C# DLL that I intend to call from an unmanaged C++ app. I have so far followed all the rules that Microsoft explains in this article: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/csref/html/vcwlkcominteroppart2cservertutorial.asp[^]. My ultimate goal is to have a method in the C# DLL which will populate a string OUT parameter, and call it from C++. Something like void GetErrorString( int iErrorCode, ref string szErrorString ) . Now do not take that signature seriously - because that is what the question is! What should be the signature???? And how exactly do I call it from C++?
So far I have tried:
Attempt 1.
C# signature:
void Func2( int iCode, ref char [] szOut );
C++ call:
char szRetString[ 128 ];<br />
cpi->Func2( 10, &szRetString );
Result: Runtime error
Variation: Instead of "&szRetString" in C++, tried "szRetString". Same result.
Variation: Instead of "ref" in C#, tried without ref. Same result.
Attempt 2.
C# signature:
void Func2( int iCode, ref string szOut );
C++ call:
char szRetString[ 128 ];<br />
cpi->Func2( 10, &szRetString );
Result: Runtime error
Variation: Instead of "&szRetString" in C++, tried "szRetString". Same result.
Variation: Instead of "ref" in C#, tried without ref. Same result.
Attempt 3.
C# signature:
void Func2( int iCode, ref StringBuilder szOut );
C++ call:
char szRetString[ 128 ];<br />
cpi->Func2( 10, &szRetString );
Result: Runtime error
Variation: Instead of "&szRetString" in C++, tried "szRetString". Same result.
Variation: Instead of "ref" in C#, tried without ref. Same result.
And all the cross-variations of the above combinations as well!!!!
Can somebody please tell me where am I going wrong? My C++ project does not have UNICODE defined. But please note that I have succeeded in calling the example provided by the MSDN article (link above) - which means I am successful in sending a read - only copy of string as IN parameter into C#.
Ever wondered that microsoft examples avoid the harder part?;)
Koushik Biswas
-- modified at 16:06 Thursday 2nd March, 2006
|
|
|
|
|
Ok so I have this method:
<br />
public static string ConvertFileName(string fn)<br />
{<br />
Regex.Replace(fn, "[^\\w\\s\\.\\{}_\\-\\$&\\^!;#\\+=%]", "_");<br />
<br />
if (fn.Length > 31)<br />
fn = fn.Substring(0, 28) + ".doc";<br />
<br />
return fn;<br />
}<br />
It is supposed to take the string fn and replace any characters that do not match the regex given with underscores. For example the file name: "Horses (Big Ones).doc" should be made into "Horses _Big Ones_.doc". However, it changes nothing right now. Any suggestions what the issue is here. Ran it through a regex tester at http://www.fileformat.info/tool/regex.htm it ran fine there.
Thanks
-- modified at 15:40 Thursday 2nd March, 2006
|
|
|
|
|
That is because you do the replacement and throw away the result. The Replace method returns a string, you have to take care of the return value.
---
b { font-weight: normal; }
|
|
|
|
|
Wow... I'm going to uninstall VS, give my computer to charity, and become a monk now. I feel like an idiot. Thank you for the quick and correct response
|
|
|
|
|
I could not help stopping expressing my satisfaction on the software "RegexBuddy" for Generating Regex Snippets. This software will take description from you and generate Right Regex Snippet for you.
http://www.regexbuddy.com/
|
|
|
|
|
|
anyone know about how to extract attribute's values from meta tags in html using regular expression or dom??
|
|
|
|
|
Hi,
I have written code to dispay an xml file on the command prompt, but wierdly, I am getting system.setting[] as the output instead of the xml file..I have entered in parameters such as /xml and a path.
Here is my code..
Can anyone tell me what wrong and why I am getting a difference output ?
using System;
using System.Xml;
namespace EliteDMSUtilities
{
///
/// Summary description for Class1.
///
class EntryPoint
{
///
/// The main entry point for the application.
///
[STAThread]
static void Main(string[] args)
{
//string[] args = new string[10];
//args[0] = "/xml";
//args[1] ="C:\Test\Elite_Dms_SystemSetting.xml";
if( args.Length >0)
{
if(args.GetValue(0).ToString()== "/xml")
{
Execute_Cmd_xml(args);
}
else
{
Console.WriteLine("Unrecognized command");
Console.ReadLine();
}
}
}// end of main
static void Execute_Cmd_xml(string[] args)
{
Console.WriteLine(args.ToString());
string sIFolderName ="";
try
{
XmlDocument doc = new XmlDocument();
if (args.Length > 1)
{
for(int i=1; i < args.Length; i++)
sIFolderName = sIFolderName + " " + args.GetValue(i).ToString().ToLower();
sIFolderName = sIFolderName.TrimStart();
Console.WriteLine(sIFolderName);
doc.Load(sIFolderName);
Console.Write(doc.OuterXml);
Console.ReadLine();
}// end if
}
catch(XmlException xmlEx)
{
Console.WriteLine("Failed to load " + sIFolderName, xmlEx.Message);
}
}
}
}
Thanks
|
|
|
|
|
Hello,
I just had a general question about MSComm32 or Serial Communications in .NET. When using binary transmission and receive with RThreshold = 1 (OnComm fired after every byte), does the transmission of binary data act the same as the receive data? Meaning, do I have to place one byte at a time in the MSComm.output field or can I place a whole byte array into MSComm.output?
I tried looking for examples, but every sample I found uses text transmission or is in Win32 Native.
Any help is much appreciated. Thanks in advance.
Mike
|
|
|
|
|
hi all, im creating a pocket pc application that uses some web services,
using ms visual studio 2005 release edition(not the beta version). i have downloade active sync and i'm using the device emulator (pocket pc 2003 se) to deploy the application but i get the error "unable to connect to remote server" ,any help?
|
|
|
|
|