|
That's quite simple.
Your plugin installer will have to know the path your main app has been installed into.
You can set a registry entry during installation of your main app to hold this information by setting its value to "[TARGETDIR]".
In your plugin installation project, you can add a registry search to your start conditions that's searching for this registry entry.
If the search found a value, assign this value to a variable, e.g. MAININSTALLDIR.
Now set the default value for the installation directory to [MAININSTALLDIR] and remove the dialog where the user can choose the installation location and you're done.
Regards,
mav
|
|
|
|
|
How do i set the [TARGETDIR] after I get the value from the registry?
|
|
|
|
|
Go to the file system editor, select the application directory and enter [MAININSTALLDIR] (resp. the name for your variable) for DefaultLocation (the standard value is [ProgramFilesFolder][Manufacturer]\[ProductName], but you want the directory you found in the registry).
Regards,
mav
|
|
|
|
|
I have an Xml document which I am trying to load via XmlDocument.LoadXml(...). However, the document has é and â entities in them. How can I make the XmlDocument resolve these? Editing the original xml document is not an option.
Is there some way to give the XmlDocument a list of entities before Loading the xml document?
Thanks,
...Matt
|
|
|
|
|
The é and ê should have been é and &circ.
...Matt
|
|
|
|
|
|
Are you referring to overriding XmlValidatingReader.ResolveEntity() ?
The problem with that is that the internals of XmlValidatingReader are hidden, so I'd have to re-implement the class.
If you are referring to something else, could you provide more details please?
Thanks,
...Matt
|
|
|
|
|
hi,
I don't have access to VisualStudio right now so I can't try, but I *think* XmlValidatingReader should figure out how to expand entity from DTD by itself. Basically, XML don't have problem with numeric entities - e.g É is ok, but É is defined in DTD and when reader don't parse DTD of document, it is problem. I belive you don't have to change anything. IMO XmlValidatingReader use ResolveEntity[^] automatically.
Somebody correct me if I am wrong.
David
Never forget: "Stay kul and happy" (I.A.)
David's thoughts / dnhsoftware.org / MyHTMLTidy
|
|
|
|
|
The problem is that the XmlValidatingReader throws an XmlException when it sees the é since it's not defined in an entity in the Xml document nor in any DTD referenced by the Xml file. Modifying the Xml to add a DTD is not an option, since it's being downloaded from a web server beyond my control (it's an RSS feed).
So I'd like to somehow say "I know that 'é' isn't defined in the DTD, but I'd like it to be resolved by..."
I suppose I could do a pre-process step to search and replace the raw Xml data before parsing, but I'd like to find a more robust solution.
...Matt
|
|
|
|
|
Matt Houser wrote:
The problem is that the XmlValidatingReader throws an XmlException when it sees the é since it's not defined in an entity in the Xml document nor in any DTD referenced by the Xml file.
Undefined entity? Your XML is broken. (well I know it's not your faul, but I am markup purist )
Matt Houser wrote:
So I'd like to somehow say "I know that 'é' isn't defined in the DTD, but I'd like it to be resolved by..."
I have no idea how to tell XmlValidating reader which DTD it should use, other then write it in document itself.
Matt Houser wrote:
I suppose I could do a pre-process step to search and replace the raw Xml data before parsing, but I'd like to find a more robust solution.
First idea: why not add (HTML probably*) doctype in pre-process? Shouldn't be a big deal. Plus it's more general and effective then search & replace.
* or your own doctype - just copy entity defintions from HTML DTD.
hope it helps
David
Never forget: "Stay kul and happy" (I.A.)
David's thoughts / dnhsoftware.org / MyHTMLTidy
|
|
|
|
|
i have a windows application, is there a way to know if the capslock key is lock or not.
thx
daonlyone
|
|
|
|
|
Sure, the following is a quick example, you have to P/Invoke the call to GetKeyState . Give this a try:
[DllImport("user32.dll")]
static extern short GetKeyState(int nVirtKey);
public bool IsCapsLockOn()
{
short keyState = 0;
keyState = GetKeyState((int)Keys.CapsLock);
return(keyState == 1 || keyState == -127);
}
private void button1_Click(object sender, System.EventArgs e)
{
if(IsCapsLockOn())
{
MessageBox.Show("Caps Lock is on");
}
else
{
MessageBox.Show("Caps Lock is off");
}
}
|
|
|
|
|
|
I am trying to find out what is inside my dataset. I have inserted a break in the program and right click on the dataset when it is highlighted and open the quickwatch. I have searched the heirarchy inside the quick watch but to no avail. I am looking for some guidance on how to navigate the dataset to find out what is inside of it. I keep getting an error,"A field property with the name 'stopnum' was not found on the selected datasource." I am using a stored procedure to populate the dataset and the first field of the stored procedure I use as and name it stopnum. Any guidance would be appreciated.
Scott Moore
|
|
|
|
|
There are several techniques you could try.
* Write a little routine that can output the desired information to a file or other debug information destination. Then, comment out or otherwise remove the code when it has finished being useful.
* Use the watch window to actually call a function that can display the information you desire. With VS 2003, this is often much easier to read than running through the object's properties. But, be warned that the method will be called each time you break at a new location in the code, so pay attention to performance if that could be a problem.
* Try out the beta of VS 2005, since it is supposed to have much improved debug displays for this sort of thing.
John
"You said a whole sentence with no words in it, and I understood you!" -- my wife as she cries about slowly becoming a geek.
|
|
|
|
|
One way could be to add a datagrid and set its datasource to be the dataset you are debugging.
|
|
|
|
|
|
I have read that article and am not sure where to put the code to get that to work. I am new to C#, have only been using it for about three or four months. If you can give me some guidance as to where to put the code I would appreciate it!
Scott Moore
|
|
|
|
|
How do find the user's application folder name? If I wanted to create a folder to store certain data and place it in a folder like this "C:\Documents and Settings\UserName\Local Settings\Application Data\ApplicationFolder" how can I check to see if the folder exists? Can this be done with the "Environment" or "Directory" class?
|
|
|
|
|
Use Environment.GetFolderPath with enumerated parameter SpecialFolder.ApplicationData or use Application.UserAppDataPath .
|
|
|
|
|
Hi,
Read up on System.Environment.GetFolderPath[^], and you'll have the answer you need!
John
"You said a whole sentence with no words in it, and I understood you!" -- my wife as she cries about slowly becoming a geek.
|
|
|
|
|
|
All pactual paths for the various special folders are cataloged in
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders
Anger is the most impotent of passions. It effects nothing it goes about, and hurts the one who is possessed by it more than the one against whom it is directed.
Carl Sandburg
|
|
|
|
|
I built a class library in C#. It consists of one public method as shown below.
public int calculate(int x,int y)
{
return x+y;
}
And I built the .tlb file using Regasm.exe for using it in VC++ 6.0.
I created the object for the interface also.
but, I can't call the methods in the class. I instatiated in the the interface as follows.
void CDialogDlg::OnButton4()
{
MYSampleLib::_SampleClassPtr ptr;//(__uuidof(MYSampleLib::_SampleClass));
ptr.CreateInstance(__uuidof(MYSampleLib::_SampleClass));
int i = ptr.calculate(90,80);
}
I got the following error.
error C2039: 'calculate' : is not a member of '_com_ptr_t<class _com_IIID<struct MYSampleLib::_SampleClass,&struct __s_GUID _GUID_3ec86308_ba43_3a5e_936f_5fd96c29c651> >'
what's the Chaos here???????
I'm not sure, this is the correct question in this thread or not ........
Thanks,
Zxczc
|
|
|
|
|
You should probably ask this in the VC++ forum, not C#. However, even though it's been a while since I did this sort of thing in VC++, I believe you will first need to change ptr.calculate to ptr->calculate .
John
"You said a whole sentence with no words in it, and I understood you!" -- my wife as she cries about slowly becoming a geek.
|
|
|
|