|
|
|
LiamD wrote:
Does anyone know how I could do this?
Either in C++, or via your MSI generator.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Do you have a link describing how to doing this? I would have thought it a fairly common thing to do.
Thanks,
Liam
|
|
|
|
|
Which one ? Doing it in an MSI is in the help of whatever installer you use, and the C++ code just checks the registry key - here's some code:
bool CRDCInstallerDlg::NeedsDotNet()
{
HKEY key;
bool bRunInstall = true;
ERRORMESSAGE("Checking for .NET", 1);
if (ERROR_SUCCESS == ::RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\.NETFramework\\policy\\v1.1", 0, KEY_READ, &key))
{
ERRORMESSAGE("Found registry key", 2);
// Grossly simplified this test because Matt was reporting this was returning true when it should return false.
bRunInstall = false;
BYTE val[10];
DWORD len = 10;
if (ERROR_SUCCESS == ::RegQueryValueEx(key, "4322", NULL, NULL, &val[0], &len))
{
ERRORMESSAGE("Found item 4322", 2);
// Yuck, yuck, yuck. I get an array of bytes out of the registry, but I need a char array for strcmp.
char * pVal = (char*)&val[0];
if (0 == ::strcmp(pVal, "3706-4322"))
{
ERRORMESSAGE("Value is correct", 2);
}
}
::RegCloseKey(key);
}
return bRunInstall;
}
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
You should use Bootstrapper:
http://msdn.microsoft.com/vstudio/downloads/tools/bootstrapper/
|
|
|
|
|
Hi,
I have created a DLL component in Vb.net, i want no other project/person use my component, how to stop outside access .
Advance Thanks
aB
|
|
|
|
|
Baste wrote:
I have created a DLL component in Vb.net, i want no other project/person use my component, how to stop outside access .
You could use an obfuscator on the assembly to prevent people disassembling the IL.
And you could also have an Auth(string passwd) method which has to be called first before any of the other exposed interfaces work properly.
|
|
|
|
|
String 1 is the regex parsing string. String 2 is the string I am trying to parse. Note that String 2 is a continuous line and therefore it is matching almost everything in (?<report_desc>.+) part of the parser.
Anyone know how I can get around this?
String 1:
StatusArray\[\d+\] = "(?<status>.)";JodIdArray\[\d+\] = "(?<job_id>\d+)";FormatTypeArray\[\d+\] = "(?<format_type>\d+)";FileNameArray\[\d+\] = "(?<filename>\w*)";FileExtArray\[\d+\] = "(?<file_extension>\w{3})";ReqNameArray\[\d+\] = trimAll\(\"(?<report_desc>.+)"\);ApplId\[\d+\] = "(?<app_id>\d+)";ExeId\[\d+\] = "(?<exe_id>\d+)";Qid\[\d+\] = "(?<query_id>\w+)";DivId\[\d+\] = "(?<div_id>\d+)";CountryId\[\d+\] = "(?<country_id>..)"
String 2:
StatusArray[0] = "E";JodIdArray[0] = "98155582";FormatTypeArray[0] = "1";FileNameArray[0] = "_98155582_";FileExtArray[0] = "zip";ReqNameArray[0] = trimAll(" WF Product Characteristics- Comp Stores ");ApplId[0] = "300";ExeId[0] = "264";Qid[0] = "Q680";DivId[0] = "1";CountryId[0] = "US";StatusArray[1] = "N";JodIdArray[1] = "98110301";FormatTypeArray[1] = "1";FileNameArray[1] = "_98110301_";FileExtArray[1] = "xls";ReqNameArray[1] = trimAll(" Trash supply metrics - total stores D14 ");ApplId[1] = "300";ExeId[1] = "263";Qid[1] = "Q10001";DivId[1] = "1";CountryId[1] = "US";StatusArray[2] = "N";JodIdArray[2] = "98110298";FormatTypeArray[2] = "4";FileNameArray[2] = "_98110298_";FileExtArray[2] = "zip";ReqNameArray[2] = trimAll(" IT - US - WM - POS Sales - ItemWeekStoreType - Dept 93-99 - LY ");ApplId[2] = "300";ExeId[2] = "264";Qid[2] = "Q680";DivId[2] = "1";CountryId[2] = "US";StatusArray[3] = "N";JodIdArray[3] = "98110290";FormatTypeArray[3] = "4";FileNameArray[3] = "_98110290_";FileExtArray[3] = "zip";ReqNameArray[3] = trimAll(" IT - US - WM - POS Sales - ItemWeekStoreType - Dept 93-99 - TY ");ApplId[3] = "300";ExeId[3] = "264";Qid[3] = "Q680";DivId[3] = "1";CountryId[3] = "US";StatusArray[4] = "E";JodIdArray[4] = "98110213";FormatTypeArray[4] = "4";FileNameArray[4] = "_98110213_";FileExtArray[4] = "zip";ReqNameArray[4] = trimAll(" IT - US - Sales - Velocity by ItemStoreWeek - TY ");ApplId[4] = "300";ExeId[4] = "264";Qid[4] = "Q680";DivId[4] = "1";CountryId[4] = "US";StatusArray[5] = "E";JodIdArray[5] = "98110212";FormatTypeArray[5] = "4";FileNameArray[5] = "_98110212_";FileExtArray[5] = "zip";ReqNameArray[5] = trimAll(" IT - US - Sales - Velocity by ItemWeek ");ApplId[5] = "300";ExeId[5] = "264";Qid[5] = "Q680";DivId[5] = "1";CountryId[5] = "US";StatusArray[6] = "N";JodIdArray[6] = "98076304";FormatTypeArray[6] = "4";FileNameArray[6] = "_98076304_";FileExtArray[6] = "zip";ReqNameArray[6] = trimAll(" BR - Instocks ");ApplId[6] = "300";ExeId[6] = "313";Qid[6] = "Q10401";DivId[6] = "1";CountryId[6] = "BR";StatusArray[7] = "N";JodIdArray[7] = "98042022";FormatTypeArray[7] = "4";FileNameArray[7] = "_98042022_";FileExtArray[7] = "zip";ReqNameArray[7] = trimAll(" EDM_EVERYDAY_Daily_WM_POS_DOWNLOAD ");ApplId[7] = "300";ExeId[7] = "264";Qid[7] = "Q680";DivId[7] = "1";CountryId[7] = "US";StatusArray[8] = "N";JodIdArray[8] = "98042017";FormatTypeArray[8] = "4";FileNameArray[8] = "_98042017_";FileExtArray[8] = "zip";ReqNameArray[8] = trimAll(" EDM_FRI_Daily_WM_POS_DOWNLOAD ");ApplId[8] = "300";ExeId[8] = "264";Qid[8] = "Q680";DivId[8] = "1";CountryId[8] = "US";
|
|
|
|
|
Randy Walker wrote:
Anyone know how I can get around this?
Looks like your fields are ; delimited, search for anything bar ;, instead of using .*.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
This is driving me crazy ...
Why does the following code :
UdpClient uc = new UdpClient ();
try
{
uc.JoinMulticastGroup (IPAddress.Parse ("239.255.255.250"));
}
catch (Exception e)
{
Console.WriteLine (e.ToString ());
}
creates the following exception :
System.Net.Sockets.SocketException: An invalid argument was supplied
at System.Net.Sockets.Socket.setMulticastOption(SocketOptionName optionName, MulticastOption MR)
at System.Net.Sockets.Socket.SetSocketOption(SocketOptionLevel optionLevel, SocketOptionName optionName, Object optionValue)
at System.Net.Sockets.UdpClient.JoinMulticastGroup(IPAddress multicastAddr)
If I go and create a UDP socket and try to set the multicast option I get the same exception. I'm puzzled.
Sylvain
|
|
|
|
|
The socket hasn't been created. For multicast to work practically, you need to specify a port - you can't just use a dynamic port. Specify the port number in the UdpClient constructor, and it should work.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Anyone know how to sum as decimal in SQLCE database?
I had try using below statement:
SELECT SUM(decimal(eAmount),9,6) AS Total FROM ExpenseDetail WHERE catID = 1
It give the error that it is not regcognize by SQLCE.
Please help!! Thanks in advance.
|
|
|
|
|
I have completed a .NET C++ project however the icon for the executable is the old DOS icon. How would I make it so that an icon I created would be the executable icon instead of the old DOS icon? Thank you very much. Also, my program gets much of the information needed from text files. Is there a way to bind those text files to the executable as well? Thank you again.
|
|
|
|
|
pcxboy wrote:
I have completed a .NET C++ project
A VS.NET project ?
If so ,then just go to Project menu and then Properties and then you will find app.ico name asociated with the Icon property of the project ,there you can replace the icon of the exe itself by yours.
|
|
|
|
|
I wasnt able to find the Icon propert of the project.
|
|
|
|
|
Right click your project in the solution explorer and click properties,then you will find in the right pan a field called Application Icon,just browse to your icon and it will be as well.
|
|
|
|
|
pcxboy wrote:
Is there a way to bind those text files to the executable as well? Thank you again
You can just put them in the same directory,and open them by StreamReader object.
|
|
|
|
|
|
if it can, I wouldnt know how to go about doing it, nor how to access that information
|
|
|
|
|
Cheat, Make your icon and rename it app.ico and place it in the project folder.
|
|
|
|
|
HA HA HA ha . Yes, thats exactly what I did. I couldn't figure out how to do the other suggestions, even the online ones. Also, I decided to turn each text file into its own seperate class . Very time consuming and increased the size of the program, but it worked. Thanks for all the help.
|
|
|
|
|
Hi,
I'm trying to activate a process on a remote machine and doing so successfuly. The only problem is that I' havn't figured out how to know when the process has ended.
here is an example of the code:
private void run_notepad(string machina)
> {
> ManagementOperationObserver observer = new
> ManagementOperationObserver();
> completionHandler.MyHandler completionHandlerObj = new
> completionHandler.MyHandler();
> observer.ObjectReady += new
> ObjectReadyEventHandler(completionHandlerObj.Done);
>
> string stringMachineName;
> string stringCommandLine;
> stringCommandLine="c:\\winnt\\notepad.exe";
> //Connect to the remote computer
> ConnectionOptions co = new ConnectionOptions();
> stringMachineName = machina;
> //get user and password
> if (machina!="")
> {
> co.Username = "aaa";
> co.Password = "******";
> }
> //Point to machine
> System.Management.ManagementScope ms = new
> System.Management.ManagementScope("\\\\" + stringMachineName +
> "\\root\\cimv2", co);
> //get process path
> ManagementPath path = new ManagementPath( "Win32_Process");
> //Get the object on which the method will be invoked
> ManagementClass processClass = new ManagementClass(ms,path,null);
> //Create an array containing all arguments for the method
> object[] methodArgs = {stringCommandLine, null, null, 0};
> //Execute the method
> processClass.InvokeMethod (observer, "Create", methodArgs);
>
anybody knows how to tell when the process exited?
Thanks,
Haim
|
|
|
|
|
can anyone guide me how to access .net webservice from my pocket pc that is ofcourse using .net compact framework. give a simple example of code. your quick response will be highly appreciated.
|
|
|
|
|
Just like you would in a Windows app. Add a web reference. I ran into some trouble once, where the client just threw some exception. Solved that by using a tool that generated a C# code file from the webservice.
|
|
|
|