|
S. Senthil Kumar wrote: unwinding the function stack and returning.
Could you explain please?
---
With best regards,
A Manchester United Fan
The Genius of a true fool is that he can mess up a foolproof plan!
|
|
|
|
|
Well, just break out of the loop if you have one and return gracefully. Something like
void ThreadFunc()
{
while (someCondition)
{
if (threadAbort)
break;
}
}
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Having used a MonthCalendar control in my project, I encountered a problem about a change in its size when I open my codes in another computer which has a different resolution. I try to use the Locked property, but unfornately it doesn't work at all. Only width size of it changes. So, how can I fix this problem? If it's possible I want to keep its size fixed for all machine. Thanks a lot for whatever suggestion! Merry X'mas. Happy New Year!
|
|
|
|
|
I have one problem.
How to read yahoo address book. if u provide me source code.
Plz any one one help me for this query....
Ashsih
|
|
|
|
|
You should contact Yahoo! asking them for the API you need to do this.
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
|
|
|
|
|
Please excuse my frustration, but how the heck do you get an IServiceProvider interface in a .net windows form for the web browser?
I've used various versions of this to no avail...
Guid g = new Guid( "6d5140c1-7436-11ce-8034-00aa006009fa" );
IntPtr ipDoc = Marshal.GetIUnknownForObject( axWebBrowser1.Document);
IntPtr ipSP;
object obj;
Marshal.QueryInterface(ipDoc, ref g, out ipSP);
The IntPtr that comes back is the same as that I passed in for the document but no ServiceProvider.
I can get it just fine in an MFC app but there is some kind of a problem on the .Net side.
In fact, I can't seem to get any interface with Marshal.QueryInterface...
-- modified at 8:28 Thursday 22nd December, 2005
|
|
|
|
|
Never mind, I got it. (You have to define the IServiceProvider idl, or whatever the hell that COM thingey is called, in your own namespace so that it doesn't clash with System.IServiceProvider )
"Patriotism is the first refuge of a patriot."
|
|
|
|
|
I have a problem and I hope someone helps me fast...
Platform : Windows.
Language : C#
I have created two classes.Both these class are in a dll file The Class First is an internal class and the class Second has public functions which can be used by a client(.exe). Now the class Second contains an object of the first class.
First f = new First() ;
Also the class First raises some events which are captured by the class Second.
f.Hi += new hi() ;
Now i want, the client (.exe) to catch these events raised by the class First so what i am doing in class second is
private void hi()<br />
{<br />
RaiseHiEventforClassSecond()<br />
}
Now this event raised by Second is being caught by the client. So what is happening is
The event is being raised by First and the notification should go to client(.exe) but Second is in the middle. Also the user will not be able to make an instance of the class First in his (.exe) because First is an internal class. So Second is just passing the event from the first to client(.exe) by capturing the event and raising it again.
Now please don't ask me why I am doing this? Just that it is a requirement. Is my method OK or is there a better way of doing this???
Thanks,
Bikash Rai
|
|
|
|
|
My opinion? That's totally ok.
You should just consider taking .Net conventions into account:
1. Delegates for events should be declared like this: void MyDelegate(object sender, MyEventArgs args)
2. Event raising methods should be declared like this: protected virtual void OnMyEvent(MyEventArgs args) {}
|
|
|
|
|
Thanks Robert... Will keep the conventions in mind.
Bikash Rai
|
|
|
|
|
Import yahoo address book in .net application then what are API responsible for this.
Can you provide me open source code for import yahoo address book.
|
|
|
|
|
Please don't repost question - people will answer you if they know the answer. Reposting the same question just 4 or 5 posts apart will more likely irritate people.
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
|
|
|
|
|
Probably no-one answered you before because there is no API for this.
Unless Yahoo has some sort of service to export this stuff into a file for you, but I doubt it. I haven't seen anything on it...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi All,
I'm using Whidbey Beta 2, and I can't find the Solution Configurations drop-down anywhere.
Under Tools – Options – Projects and Solutions – General, there are options
Always show solution and Show advanced build configurations.
The Show advanced build configurations includes the Configuration Manager and the Solution Configurations and Solution Platforms combo box on the standard toolbar.
I have checked both the options still combobox is missing in the standard toolbar.
The only way I see to change to Release mode is to open the Configuration Manager from Build menu.
I've tried customizing the toolbars to add it, but there's nothing under the Build list
On Standard toolbar in VS2003 we use to have "Solution Configurations", which is missing in whidbey.
Any idea why it's missing now? Using which toolbar we can get it?
Please help.
Hiral
|
|
|
|
|
Hi:
I've been developing a program that loads a file for default settings which I have placed for now in the bin\debug folder under the project that uses it. This works fine for development, but I want to make a release kit for other users.
I have made a 'Setup wizard' project and have included the default settings file to be loaded into the Application folder.
My question is, what path do I hardcode into the default settings loading call?
I tried just using the file name in this call and the release executable goes to the Documents And Settings\userid\ folder to look for defaults file - and of course complains when it does not find it there. I'd like to avoid hardcoding the path to the application folder since at installation time the users have discretion to install to any folder of their choice.
Please give me your suggestions.
Thanks, Sam
|
|
|
|
|
smurfy34 wrote: what path do I hardcode
:SMACK: Stop right there! You don't hardcode paths into your code, ever! This is because sometimes people don't have their Program Files folder on the C: drive, or someone might not install your app in the folder you think they will.
Two rules: Don't ever hardcode paths. never assume that the current directory is what you think it is. And always use comlete, full qualified paths when specifying a file to work with.
You'll save yourself many a headache trying to troubleshoot a problem on a customers machine when you can't replicate the problem on your test machine.
So, if I can't hardcode a path, how can I possibly build a fully qualified filepath?
Easy. If you put the configuration file in the same folder as the .EXE, you can use <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformsapplicationclassstartuppathtopic.asp" rel="nofollow">Application.StartupPath</a>[<a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformsapplicationclassstartuppathtopic.asp" target="_blank" rel="nofollow" title="New Window">^</a>] to get the path to the folder that the .EXE is in, then just use <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemiopathclasscombinetopic.asp" rel="nofollow">Path.Combine</a>[<a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemiopathclasscombinetopic.asp" target="_blank" rel="nofollow" title="New Window">^</a>] to combine the StartupPath with the filename of your config file to get the complete path to the file.
string configFilePath = Path.Combine( Application.StartupPath, @"config.filename" );
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Or you may use
Environment.CurrentDirectory
which will give the the directory from where the process starts.
Hope this helps...
Bikash Rai
|
|
|
|
|
Bikash Rai wrote: which will give the the directory from where the process starts.
It will give you the folder that was current when the process started, not necessarily the folder that the .EXE is in.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Exactly what I said. The process starting directory.....
Bikash Rai
|
|
|
|
|
Wait a minute... He's not looking for the directory from where the app was started. He's looking to get the directory that the .EXE is in, so it knows where to pick up this config file.
Environment.CurrentDirectory will return the current directory can never be relied on to be the directory the .EXE is in. This is because there are many ways to launch an .EXE, each of which can have a different current directory:
If the .EXE is launched directly, by double-clicking it's icon, the current directory will be the folder that the .EXE is installed in.
If the .EXE is launched by a shortcut, the current directory will be the directory specified in the shortcut, if it's specified. If not, then the current directory can be anything!
If the .EXE is launched by a batch file, then the current directory will be the last directory listed in the command prompt, i.e. C:\WINDOWS.
Application.StartupPath will give you the directory that the .EXE is in, no matter what it is or where it's launched from.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dave Kreskowiak wrote: Wait a minute... He's not looking for the directory from where the app was started. He's looking to get the directory that the .EXE is in, so it knows where to pick up this config file.
Environment.CurrentDirectory will return the current directory can never be relied on to be the directory the .EXE is in. This is because there are many ways to launch an .EXE, each of which can have a different current directory:
If the .EXE is launched directly, by double-clicking it's icon, the current directory will be the folder that the .EXE is installed in.
If the .EXE is launched by a shortcut, the current directory will be the directory specified in the shortcut, if it's specified. If not, then the current directory can be anything!
If the .EXE is launched by a batch file, then the current directory will be the last directory listed in the command prompt, i.e. C:\WINDOWS.
Application.StartupPath will give you the directory that the .EXE is in, no matter what it is or where it's launched from.
Yes Dave, I am aware of what I have written. I was just trying to be more helpful by giving other options which could be tried out, if for some bizzare reason the Application.Startup solution was not the one he was looking for.
Just trying to be helpful, no hard feelings.
Bikash Rai
|
|
|
|
|
Special folder can be got from the
Environment.SpecialFolder enumeration.
If a folder path of one the enumerations is needed then
Environment.GetFolderPath(Environment.SpecialFolder.Desktop) gives you the full path of the destop folder of the currently logged in user.
If you are talking about the SetupWizard then the variable
TARGETDIR gives you the directory where the application is getting installed.
Hope this helps...
Bikash Rai
|
|
|
|
|
Hi,
I have a native DLL exporting somes functions (__declspec( dllexport )).
I have converted the project in VS 2005... all work fine.
I try now to compile the project with /clr option.
All work fine.
But when I compile my other project (this project call functions from the native DLL)
(it's in native compiled in VS 2005 with /clr option),
when it link I got lot of error like this:
NodeRDTiff.obj : error LNK2028: unresolved token (0A00024C) "int __cdecl file_Close(void *)" (?file_Close@@$$FYAHPAX@Z) referenced in function "public: virtual void __thiscall CNodeRDTiff::ReleaseFile(void)" (?ReleaseFile@CNodeRDTiff@@$$FUAEXXZ)
But if I compile the first project without /clr, the second project will link correctly.
Someone can help me ?
Best regards,
===================
Martin Bonneville
Analyst-programmer
|
|
|
|
|
Go To->Project Properties->Linker->Input Screen
In the additional dependencies add msvcmrt.lib.
Check it out if it helps to solve the issue.
HV
|
|
|
|
|
Hi,
I added msvcmrt.lib to the dependencies of my 2 projects... I got the same error.
Best regards,
==========================
Martin Bonneville
Analyst-programmer
|
|
|
|