|
Quick question: I'm working on a managed plugin to an open source unmanaged application. To achieve this I have an MC++ bridging dll plugged into the unmanaged host, which itself hosts a C# dll which does the real work:
Host App ---> MC++ Bridging Dll (a thin interface) ---> C# Dll (does the real work)
When the host app calls a Run function, my plugin bursts into life. I instantiate a whole bunch of managed objects exposed by the C# dll into an unmanaged structure by using the gcroot template; so as to be able to "store" managed objects inside that unmanged data structure jointly owned by the host app and the MC++ bridge. It works pretty well.
But here's the catch; to add more functionality to my plugin, my bridging dll will need to handle a few callbacks from the host app. My original plan was that'd I'd write a callback procedure which simply forwards the event into the C# dll through the use of a delegate. The catch is that to do any delegate invoking, I need to access my managed objects (which are the interfaces) in their gcroot s - however the .net framework seems to balk at this, complaining that thread of the callback is in another AppDomain.
I presume the solution to this problem is to somehow get a thread that is in the correct app domain to handle the event. However, the only ways to do this, that I can think of involve yucky polling, or OS thread synchronisation Events.
Can anyone suggest a really elegent way around this little problem of mine?
Joel Holdsworth
Want to give me a job this summer?
Take a look at my online CV
|
|
|
|
|
1)system("cls");
who can tell me ?thk, pls write it simple !!!
2) char ch1='*', ch2=' ';
what is the ch2=' '; mean ?
|
|
|
|
|
|
This is a pure guess, but "cls" sounds like the old dos (aka console) "clear screen" command.
Indeed, I have just tried it and it still clears the screen.
system("command name");
also sounds like some invocation of a command.
Hope it helps
|
|
|
|
|
|
how can i make program that will login in hotmail acount and take all email address in this email
--------------------
in othere words i have web site that have username as email and password
i want to program to test login to this account and all email address in this account
to send advertisment to this email
how can i do that ??
Palestine
|
|
|
|
|
trying to hack someone's hotmail account ?!
|
|
|
|
|
no i want program to make more than 100 email in the same time
Palestine
|
|
|
|
|
hacking the servers so
|
|
|
|
|
hahahaha
i just to make advertisment
Palestine
|
|
|
|
|
this is illegal...
|
|
|
|
|
Sir! This is a verry verry difficult task! Is not just the matter that such program should containt hundert of towsends lines of code - hmmm, maybe milions - but you will need also some verry powerfull machines to run it in a reasonable ammount of time. For example, on a cluster with 64 servers, each powered by 64 intel celeron processors, the process should took about 7500 hours to run for a single account!!! And, as a final point: I speak here about fast plain C programs, not about some bloated managed app., as you request...
|
|
|
|
|
I think ppl who voted you down did not get ur sarcasm
-Prakash
|
|
|
|
|
Finally, somebody got it! Indeed... it was only sarcasm in my posts...
So, you got my 5!
Cheers!
|
|
|
|
|
Hello , I copied a sample from msdn, but the compailer doesn't understend most of the language wordes ,The sample itself not importent for now,Only the compailer problem.
the semple is:
using namespace System;
int main()
{
array^args = Environment::GetCommandLineArgs();
const double tipRate = 0.18;
double billTotal;
if ( args->Length != 2 )
{
Console::WriteLine( "usage: TIPCALC total" );
return 1;
}
else
{
try
{
billTotal = Double::Parse( args[ 1 ] );
}
catch ( FormatException^ )
{
Console::WriteLine( "usage: TIPCALC total" );
return 1;
}
double tip = billTotal * tipRate;
Console::WriteLine();
Console::WriteLine( "Bill total:\t{0,8:c}", billTotal );
Console::WriteLine( "Tip total/rate:\t{0,8:c} ({1:p1})", tip, tipRate );
Console::WriteLine( ((String^)"")->PadRight( 24, '-' ) );
Console::WriteLine( "Grand total:\t{0,8:c}", billTotal + tip );
return 0;
}
}
/////////////////////////////////////////////////////
and I get this answer from compiler:
/////////////////////////////////////////////
------ Build started: Project: testing_from_books, Configuration: Debug Win32 ------
Compiling...
general_uri.cpp
.\general_uri.cpp(2) : error C2871: 'System' : a namespace with this name does not exist
.\general_uri.cpp(5) : error C2065: 'array' : undeclared identifier
.\general_uri.cpp(5) : error C2065: 'String' : undeclared identifier
.\general_uri.cpp(5) : error C2059: syntax error : '>'
.\general_uri.cpp(5) : error C2653: 'Environment' : is not a class or namespace name
.\general_uri.cpp(8) : error C2065: 'args' : undeclared identifier
.\general_uri.cpp(8) : error C2227: left of '->Length' must point to class/struct/union/generic type
type is ''unknown-type''
.\general_uri.cpp(10) : error C2653: 'Console' : is not a class or namespace name
.\general_uri.cpp(10) : error C3861: 'WriteLine': identifier not found
.\general_uri.cpp(17) : error C2653: 'Double' : is not a class or namespace name
.\general_uri.cpp(17) : error C3861: 'Parse': identifier not found
.\general_uri.cpp(19) : error C2061: syntax error : identifier 'FormatException'
.\general_uri.cpp(19) : error C2310: catch handlers must specify one type
.\general_uri.cpp(21) : error C2653: 'Console' : is not a class or namespace name
.\general_uri.cpp(21) : error C3861: 'WriteLine': identifier not found
.\general_uri.cpp(25) : error C2317: 'try' block starting on line '16' has no catch handlers
.\general_uri.cpp(26) : error C2653: 'Console' : is not a class or namespace name
.\general_uri.cpp(26) : error C3861: 'WriteLine': identifier not found
.\general_uri.cpp(27) : error C2653: 'Console' : is not a class or namespace name
.\general_uri.cpp(27) : error C3861: 'WriteLine': identifier not found
.\general_uri.cpp(28) : error C2653: 'Console' : is not a class or namespace name
.\general_uri.cpp(28) : error C3861: 'WriteLine': identifier not found
.\general_uri.cpp(29) : error C2653: 'Console' : is not a class or namespace name
.\general_uri.cpp(29) : error C2059: syntax error : ')'
.\general_uri.cpp(30) : error C2653: 'Console' : is not a class or namespace name
.\general_uri.cpp(29) : error C3861: 'WriteLine': identifier not found
.\general_uri.cpp(30) : error C3861: 'WriteLine': identifier not found
Build log was saved at "file://f:\Documents and Settings\uri\My Documents\אורי\חומר ופרויקטים ב-C++\Visual Studio 2005\Projects\testing_from_books\testing_from_books\Debug\BuildLog.htm"
testing_from_books - 27 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
//////////////////////////////////////////////////////////////
Why
|
|
|
|
|
1. what compiler do you use ? (VC6, 2005 or 2005)
if VC6, then you cannot compile managed code with it.
2. if not VC6, then did you correctly create a managed project ? (not Win32 for example)
|
|
|
|
|
|
Michael Dunn wrote: Are you using VC 2005?
I assume he does. Because his path is pointing to "...\Visual Studio 2005\Projects\...". Although you don't need VS 2005 to create a path like this . From my point of view it looks like he is trying to compile C++/CLI code within a WIN32 project.
regards Tobias
|
|
|
|
|
hello Michael
Yes I am using VC 2005, I think the problem is in the project diffintion becouse when I am using Sample of msdn with there's project files It's work fine.
|
|
|
|
|
I've been trying to work with the wininet API to get the IE user agent string for use as part of a larger program I am working on. First I tried this in VB.NET but got no working results. Now I'm trying to code it in C++ as per the example on the MSDN article I found. The code I have so far is:
<code>
#include <stdlib.h>
#include <stdio.h>
#include <stddef.h>
#include <string.h>
#include <windows.h>
#include <winioctl.h>
#include <wininet.h>
int main (int argc, char * argv [])
{
DWORD dwSize;
DWORD errorCode;
bool res;
// This call determines the required buffer size.
res = InternetQueryOption(NULL,INTERNET_OPTION_USER_AGENT,NULL,&dwSize);
if (res) {
// Allocate the necessary memory.
char* lpszData = new char[dwSize];
// Call InternetQueryOption again with the provided buffer.
InternetQueryOption( NULL, INTERNET_OPTION_USER_AGENT,lpszData,&dwSize );
// Insert code here to use the user agent string data.
printf(lpszData);
// Free the allocated memory.
delete [] lpszData;
} else {
errorCode = GetLastError();
printf((char*)errorCode);
}
printf("\nDONE!");
return 0;
}
</code>
Each time it runs I get error code as a very large number (3131961397). Not sure what is going on but am hopeing somebody has the answer out there. The MSDN artitcle can be found here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wininet/wininet/setting_and_retrieving_internet_options.asp
|
|
|
|
|
|
Okay I did and I'm still getting an error. Error number comes back as -1163005939.
|
|
|
|
|
I really need help on this....
This may sound odd, but I need teh code to shutdown the windows workstation. I'm programming in C++. Heres What I have so far:
#include <iostream>
using namespace std;
int main (int argc, char *argv[])
{
cout << "H3ll0 4p0c4lyps3" << endl;
cout << "VIRUS.:.J3$U$I$C0MING" << endl;
cout << "ATTN: I know have complete control of your computer. Destruction is imminent." << endl;
cout << "R3sist4nce is Futil3." << endl;
cout << "WINDOWS ERROR!!" << endl;
cout << "CPU Usage @ 95%" << endl;
cout << "CPU Usage @ 96%" << endl;
cout << "CPU Usage @ 97%" << endl;
cout << "CPU Usage @ 98%" << endl;
cout << "CPU Usage @ 99%" << endl;
cout << "CPU Usage @ 100%. System Overheat. Windows shutdown initiating." << endl;
cout << "Please press ENTER to Continue" << endl
;cin.get();
return 1;
}
:Please help me. It's not a real virus, It's a special thing I'm doing at school on programming to get an A. email me the entire completed script to djdomino101@gmail.com. I need this ASAP.
Thanx guyz
-DJ Domino-
|
|
|
|
|
Hello,
Are you planning to play a prank on somebody? Well, you might be successful with this batch file i wrote. But i won't give you a solution in c++
@echo off
echo H3ll0 4p0c4lyps3
echo VIRUS.:.J3$U$I$C0MING
echo ATTN: I know have complete control of your computer. Destruction is imminent.
echo R3sist4nce is Futil3.
echo WINDOWS ERROR!!
echo CPU Usage @ 95%
echo CPU Usage @ 96%
echo CPU Usage @ 97%
echo CPU Usage @ 98%
echo CPU Usage @ 99%
echo CPU Usage @ 100%. System Overheat. Windows shutdown initiating.
PAUSE
shutdown -r -t 0
However, as a programmer you should make everyones life more pleasant, not harder!
regards Tobias
|
|
|
|
|
not sure if u have found the solution but here is the code i use with C.
#include <windows.h>
#include <shellapi.h>
main(){
ShellExecute(NULL, "open", "-s -f -t 23", "", SW_SHOW);
}
- Droz -
___ ___
/\/\ /\ | |
|
|
|
|