|
Thanks for your code.
Was there a question somewhere?
If so, try make it more specific than "I need help!"
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Luc Pattyn wrote: Was there a question somewhere?
If there is, I sure missed it
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
I can see how the question could have been missed, but 1-8 is what I need help with, the code I put at the bottom was a example. Threading is such a big thing on a high level, its good to know.
tim637
|
|
|
|
|
please find the good resource related to threading..........
http://www.codeproject.com/csharp/threadinginnet.asp
http://aspnet35.blogspot.com/search/label/Threading
|
|
|
|
|
Thanks for the help.
tim637
|
|
|
|
|
Hello, I’m triying to load and execute managed code using methos as shown belong
<br />
SAFEARRAY * psArr;
SAFEARRAY * Param;<br />
CComPtr <ICorRuntimeHost> spRuntimeHost;<br />
CComPtr <_AppDomain> spAppDomain;<br />
CComPtr <IUnknown> spUnk;<br />
CComPtr <_MethodInfo> MI;<br />
CorBindToRuntimeEx( NULL, L"wks", STARTUP_LOADER_OPTIMIZATION_SINGLE_DOMAIN,<br />
CLSID_CorRuntimeHost ,<br />
IID_ICorRuntimeHost ,<br />
(void**)&spRuntimeHost);<br />
spRuntimeHost->Start();<br />
spRuntimeHost->CurrentDomain (&spUnk);<br />
spUnk->QueryInterface(&spAppDomain.p);<br />
try<br />
{<br />
MI = spAppDomain->Load_3(psArr)->GetEntryPoint();<br />
Param = MI->GetParameters();<br />
MI->Invoke_3 (NULL, Param);<br />
}<br />
catch (_com_error ex)<br />
{<br />
std::wcout<< ex.ErrorMessage();<br />
}<br />
SafeArrayDestroy(psArr);<br />
So if I invoke GUI application all good, but if I invoke Console application Invoke_3() function rise an exceptional situation…
Who has any ideas how to run Console Application?
|
|
|
|
|
What is the exception that is being thrown?
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
|
Where are you initializing psArr?
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
CorError.h (in the SDK\v2.0\Include folder under your Visual Studio installation, for VS 2005) documents this as follows:
#define COR_E_SAFEARRAYTYPEMISMATCH EMAKEHR(0x1533L) I suspect that it's this bit from the documentation that's causing trouble:
"parameters
An argument list for the invoked method or constructor. This is an array of objects with the same number, order, and type as the parameters of the method or constructor to be invoked. If there are no parameters, parameters should be a null reference." (my emphasis)
If your console application's Main method doesn't take any parameters (which is permitted) I think GetParameters may give you an empty array, not a NULL pointer. But try it and see.
DoEvents : Generating unexpected recursion since 1991
|
|
|
|
|
A NULL Parameters works ONLY if we have windows GUI Application, but if we have a Console application - it rise an Exception
|
|
|
|
|
If we running Windows GUI Application, then parameters could be NULL, but if we try to run console application, parameters must not be NULL, or we will take exceptional situation
|
|
|
|
|
Is it possible to build a .NET 1.1 project as a .NET 2.0 project without converting the project files? I need to continue developing the applications in VS 2003 but build as .NET 1.1 and .NET 2.0. I am hoping this can be done via a build script but I have tried using msbuild with my .csproj files with no luck.
Any ideas gratefully received.
|
|
|
|
|
You don't need to 'build as .NET 2.0' as you put it. If you're confident that it's compatible, you can use a .config file as follows:
<configuration>
<startup>
<supportedRuntime version="v2.0.50727" />
<supportedRuntime version="v1.1.4322" />
</startup>
</configuration> The file must be named the same as your program but with a .config extension, so if your program is MyApp.exe, name the config file MyApp.exe.config. If you already have an .exe.config file, add the <startup> section to the existing configuration file.
The documentation here[^] claims that the version that the software was built for will be used if it's installed, but my experiment indicates that this is incorrect: if a configuration file is present and specifies the runtime version to use, the first version specified which is installed is used. So if you want it to run on .NET 1.1 if available, or 2.0 if only that is available, specify v1.1.4322 first. The above file will use 2.0 if available falling back to 1.1 if 2.0 is not installed.
A Visual Studio 2005 .csproj file is an MSBuild input file, a 2003 .csproj file is not. MSBee[^] allows MSBuild to target .NET 1.1; however, you will need to (presumably) import your code into VS2005.
A word on debugging: if your application will load into .NET 1.1 you must use VS2003 to debug; if it will load into .NET 2.0 you must use VS2005. Neither version can debug the other's code. You won't get any warning, it will just stop debugging immediately after it starts.
Those are the rules for EXEs. For DLLs the EXE will control the version of the framework that's loaded, and you have to use that version - only one version of the framework can be loaded into a process. If the EXE is not itself a .NET application and you're producing a class for COM Interop, and the .NET Framework is not already loaded by the process, the latest version of .NET is loaded (not the version marked in the registry for the object). You can again control this with an .exe.config file (yes, even for native code programs that were not written with .NET in mind).
DoEvents : Generating unexpected recursion since 1991
|
|
|
|
|
hi friends,
Does anyoone know how to use Nero SDk for burning DVD.
If so, pls let me know.
Thank you
Jack
|
|
|
|
|
Did you download the SDK because it'll surely have the documentation included.
AliAmjad(MCP)
|
|
|
|
|
Hi,
I have to create a SQL CE database file (*.sdf) on my PC. I intended to call several web services to get data and create a 'localDB.sdf' with a program running on my PC. I have created windows application project but I could not add reference to the System.Data.SqlServerCE assembly.
The System.Data.SqlServerCe didn't appear in the .net references tab. I had browsed and added the assembly manually but it didn't work because my framework is 2.0 and the assembly looks for CF 2.0.
How can I use the SqlCeEngine class in a Windows application? Or can I create a *.sdf file using a different class? Can I use CF assemblies on my PC?
thanks,
- ferudun
|
|
|
|
|
Please don't cross post. You asked this same question here[^] about 10 minutes earlier than you posted this one.
The people here answer questions on a volunteer basis and may not respond in a timeframe you desire or find acceptable.
|
|
|
|
|
it seems that voip protocols (h323 and sip) have all call features so where is the TAPI location in telephony architecture?
|
|
|
|
|
TAPI[^] is a programming API that implements the H.323 protocal, among other things.
H.323 is a protocol, which simply defines how things should work. TAPI (atleast 3.1) is an actual implementation of H.323.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
I have a window service and i have a Web Service reference in it.
The web service is on a local machine which is in my network.
The app.config file of the window service is containing the key for the web service.
When i make setup of the window service the its not dynamically changing the machine name even when i change the key in the config. During the run of the service it says cant find the machine "acb" which is name of the machine which is in my local network from where i was referring the web service.
When i try to find out what is wrong i find that in the Project there is a Folder My Project Which is Containing a file Settings.settings Which is containing a key for that web servce. any Idea How That can be made dynamic
Regards
|
|
|
|
|
I write mostly console programs and every once in a while I want a program to behave differently depending on whether or not the input or output is a pipe (or redirected).
A few years ago I read a Dr. Gui article describing how to use the PeekConsoleInput Windows API function to detect whether or not input is a pipe, and I've been using that for input.
But today I need a program to detect whether or not output is a pipe. I found that the WriteConsole Windows API function works pretty well for detection of piped output. (With the exception that redirecting to CON reports false.)
I'm wondering whether or not anyone else has another method for detecting these situations.
|
|
|
|
|
I took a look at how the C runtime implements _isatty . This function reads flags associated with every file handle given out by the CRT. The _ioinit function in ioinit.c initialises the arrays which hold these flags.
The code first calls GetStartupInfo to find out if the parent process provided a handle table. The code here is a bit complicated as the C runtime cheats a bit and uses cbReserved2 and lpReserved2 members to hand other handles to child processes - it basically just copies the whole handle table to the new process. I think you can omit this bit.
If the handle table didn't provide the information already - which is the situation a .NET program is in - it calls GetStdHandle using the three standard handle identifiers, STD_INPUT_HANDLE, STD_OUTPUT_HANDLE and STD_ERROR_HANDLE. If this returns a valid handle (not INVALID_HANDLE_VALUE [-1] or NULL [0]) it calls GetFileType to find out what it is. You cannot differentiate between the console and a serial or parallel port, all will return FILE_TYPE_CHAR .
DoEvents : Generating unexpected recursion since 1991
|
|
|
|
|
The Dr. Gui article uses GetStdHandle , and then PeekConsoleInput to test.
|
|
|
|
|
hi,
i have a windows project in C#(visual studio 2005) that uses some DLL i wrote in different projects.
i want to make this application to run from the web page on the local computer(ActiveX,OCX).
how can i do it?
thanks,
Samy
|
|
|
|