dev.cplusplus 0 Junior Poster in Training

Hi to all I have the following situation:
I'm creating a number of threads that does some work and then a then I wait for all the threads to finish, the following is the code I'm using, everything is working fine. Now I want to add the option to pause the threads.
I want to be enable to pause the threads that are working, I read in the web that is very dangerous, is this right, is this possible do this?
I don't want to use the spleep method, because I don't know when they should pause, I want to send them a signal or something like this, pause them and then send them another signal to continue working.
Thanks in advanced :?:

ManualResetEvent[] waitHandles;
waitHandles = new ManualResetEvent[numberOfThreads];
 // loop over the number of threads and create them
for (int i = 0; i < numberOfThreads; i++)
{
//create a worker thread
waitHandles[i] = new ManualResetEvent(false);
threadClass = new ThreadClass (number);
ThreadPool.QueueUserWorkItem(new WaitCallback(MainThread.ThreadPoolCallback), threadClass);
}
// wait for all the threads to finish
WaitHandle.WaitAll(waitHandles);
dev.cplusplus 0 Junior Poster in Training

Sorry to answer only now,but I was very busy...
Thanks for all the replies, this is the code I'm using:

var myString = "MyStr-ing-";
var specialChars = "!@#$%^&*()-+";
for(var nIndex=0; nIndex<specialChars.length; nIndex++)
myString=myString.replace(specialChars.charAt(nIndex),specialChars.charCodeAt(nIndex);

The original code is "MyStr-ing-" and after running the code the string will be "MyStr45ing-", replacing only the first appearance, any ideas how to do it in a better way, and I way that will change all the chars.
Thanks

dev.cplusplus 0 Junior Poster in Training

Hi to all, hi have the following problem, I hope someone can help me.
I need to replace special chars that appear in a string.

for example if I have the string:
this- is a !string with special chars-
I want to receive
this45 is a 33string with special chars45

* The numbers in the string are the ascii code of every char.

I try using the "replace" method, but only work with the first char appearance of the char, if I the char appear more that once in the string
the replace method replace only the first appearance.

for example if I have the string:
this- is a !string with special chars-
I receive:
this45 is a 33string with special chars-

Leaving the second '-' without changing it.

Thanks

dev.cplusplus 0 Junior Poster in Training

Hi, thanks for response.
But still I have the same problem.
What I don't understand is, I should give permissions to my ActiveX in my computer? What will happen when user runs the ActiveX in his computer?
BTW - I open the Microsoft .NET Framework 2.0 Configuration and I don't know what to change.
Any Ideas?
Thanks

dev.cplusplus 0 Junior Poster in Training

Hi to all I'm writing an ActiveX in C#, I found a great tutorial in:
http://www.c-sharpcorner.com/UploadFile/dsandor/ActiveXInNet11102005040748AM/ActiveXInNet.aspx
The problem is that my ActiveX should create a folder and do some another actions in the Client machine, according what I know when the user allow using ActiveX, the ActiveX has permissions to do every thing. When I click on the button that should create the folder I receive an error:
Application attempted to perform an operation not allowed by the security policy. To grant this application the required permission, contact your system administrator, or use the Microsoft .NET Framework Configuration tool.
See attached picture.
What I should perform, to allow to ActiveX to run properly?
Thanks in advanced.

dev.cplusplus 0 Junior Poster in Training

Hi to all, I have the following problem, I don't know if is possible to solve:
I have number of threads working, and I want that every thread to wait in some part of the code, until all the threads reach that part.
I'll explain may self:
1. In the Main thread create 'x' threads.
2. Every thread start working in its the method
3. When every thread reach some part of the code, he ask if all the other threads are in the same part
4. When all the threads reach that part, do some checking and continue

I know this is possible to wait for all threads when they finish their method, but I don't know if is possible to wait before their work. I know is possible to wait in the main thread for all the threads to end their work with "WaitHandle.WaitAll", but this method I can use it in main thread(meaning every thread go out of the its method/finsih its work).
I want something to check before the method goes out of its method.
Pseudo code:

Main
{
Create 10 Threads(CallBackThreadMethod) - Every thread start working
}
CallBackThreadMethod()
{
while(something)
{
DoWork();
Wait for all threads ->Wait for all the 9 threads to get here - Only when all the threads reach here
CheckSomething();
Continue working
}
}

Thanks

dev.cplusplus 0 Junior Poster in Training

Thanks for your quick response.
So I have to zip the folder, send it and then unzip in the server side.
Still remain the questions:
How to send it? and How to receive it(server side)?
Thanks

dev.cplusplus 0 Junior Poster in Training

Hi to all, I need your help/advice.
I'll explain my problem:
I have to write an aspx page, where the user can upload an entire directory/folder to my server.
I did some research and seem that there is no build it component to upload an entire directory/folder, there is the file upload component but no for entire directory/folder. The problem is that the page doesn't have the permissions to read the data of the users. I look in the web and the solution that seems to be acceptable is writing my own ActiveX.
After thinking about it, I came with the following questions:
1. It is possible for the ActiveX, to open a choose folder dialog? Is this implemented in C++?
2. Lets say is implemented, after I read the content of the folder(files), How I send the content(files) to the server?
3. Of course after sending the content of the folder(files), there should be a application/services/script in the server side to receive the content(files), What do you recommend to write?
Thanks for your help/advice, any help/ideas/links will be appreciated.
:?:

dev.cplusplus 0 Junior Poster in Training

Hi to all. I'm trying to get the percent of an swf object in the html page.
I'm using the method PercentLoaded(), the code is working fine in IE and not working in Firefox.
I print the percent and in IE and see 0, 20, 30....100%
In Firefox I see only 0 and then 100%.
Why the method can't get all the values.
Do you have any idea, how I can get the percent loaded of an swf object.

<script>
function waitUntilLoaded() 
{
	// get the movie in diferent way in IE/FF
	var testMovie = isIE ? window.document.testMovie : document.testMovie;	
	alert(testMovie.PercentLoaded());
	
	if(testMovie.PercentLoaded() == 100)
		return;
	else
		setTimeout('waitUntilLoaded()',10);  
}

waitUntilLoaded();
</script>
dev.cplusplus 0 Junior Poster in Training

Thanks for the response, I don't have ftp server and I don't want to create one.
I was wandering if there is a way to upload the entire directory not with ftp.
I found examples how to upload multiple files using the FileUpload control, but the problem is that the user has to choose every file at the time.
I someone know how to add files to the FileUpload control in a silent way(without prom it to the user), this should help.
Thanks in advanced

dev.cplusplus 0 Junior Poster in Training

I'm writing an C# application, where the user can select an entire folder and click on a button to upload the folder he choose.
It is possible to upload an entire Folder to a Server(with all its files and sub folders) ?
I found in the web examples, to how to upload a single file but not an entire folder, If some one have a link or an a piece code I'll appreciate.

Thanks in advanced

dev.cplusplus 0 Junior Poster in Training

I trying to change the edit box (filepath) of the "Save As.." Dialog of the Internet Explorer, on run time.
The problem is when using the method:

GetDlgItem(hwnd, 0x0470)

The file path control in Windows XP is'0x047' and in Windows 98 is '0x480'.
I found this in the web, for XP and 98 is working just fine, the problem is in Windows Vista.
In Windows Vista the method returns NULL, I guessing the control id is not the same, How I know what is the control id in Vista?
I read that using spy++, I can check the Id of controls, I noticed something wrong, when I use spy++ in windows xp and I select the control of the file path control the id is not '0x0470', it always return diferent Id (every time I open the dialog), how is this possible?
I'm missing something here?
Thanks in advanced

dev.cplusplus 0 Junior Poster in Training

Hi to all, it been a long time since my last time I write/ask in the forum.
I have the problem I hope you can help me:
I’m using the guide:
http://www.codeproject.com/KB/shell/iesaveas.aspx
(Automated IE SaveAs MHTML)
I have the problem when I’m running the code in Windows Vista
In the method:

void CSaveAsWebbrowser::UpdateSaveAs(HWND hwnd)
{
    // editbox : filepath (control id = 0x047c)

    // dropdown combo : filetypes (options=complete page;

    //     archive;html only;txt) (control id = 0x0470)

    // save button : control id = 0x0001

    // cancel button : control id = 0x0002


    // select right item in the combobox
    SendMessage(GetDlgItem(hwnd, 0x0470), CB_SETCURSEL, (WPARAM) m_nSaveType, 0);
    SendMessage(hwnd, WM_COMMAND, MAKEWPARAM(0x0470,CBN_CLOSEUP),  (LPARAM) GetDlgItem(hwnd, 0x0470));

    // set output filename
    SetWindowText(GetDlgItem(hwnd, 0x047c), m_szFilename);

    // Invoke Save button
    SendMessage(GetDlgItem(hwnd, 0x0001), BM_CLICK, 0, 0);  
}

We update the file path and the save type of the Dialog, like:

SendMessage(GetDlgItem(hwnd, 0x0470), CB_SETCURSEL, (WPARAM) m_nSaveType, 0);
SetWindowText(GetDlgItem(hwnd, 0x047c), m_szFilename);

The problem is that we send the control id ‘0x047c’,(for the combo box and the output file), I noticed that the method GetDlgItem(hwnd, 0x047c), return 0, I’m thinking the problem is that the code id '0x047c' in Vista is not relevant, I found out that for NT, Windows 98 and 95 the combobox and output file has different ID ‘0x0480’, I was wandering I someone know where I can found the id’s for Vista, or someone have another idea why this is not working.
Thanks

dev.cplusplus 0 Junior Poster in Training

Hi to all, I have the following question:
I 'm using the GridView control in aspx, I bound the data with the Wizard in VS2005.
And everything is working just fine, my problem is that I want to change the data in the Grid in runtime (meaning the user can choose some filter and receive the new data in the Grid).
I'll explain my problem:
1. When the page load the user receives all the rows from the table
2. User filter with with a combo box a insert
3. User receive the new data in grid
4. The problem is when I go over the new data, I still receive the old data, for example if I retrieve the data that is store in the row 0 in cell 0 I still get the old data.

This is the way I do it, when clicking on a button:

// retreive the current query
string str = mySqlDataSource.SelectCommand;
// add new condition + id the user input
str = str + "WHERE id= '" + txtID.Text + "'";
// here I change the query with new condition
mySqlDataSource.SelectCommand = str;
// set the sqlDatasource to the Grid
myGridView.DataSourceID = "mySqlDataSource";

* where
mySqlDataSource - Object type SQLDataSource
myGridView - Object type GridView

Like I say in the Grid I see the new data filtered, but if I retrieve the data that is store in row 0 col 0, …

dev.cplusplus 0 Junior Poster in Training

Hi to all I'm looking for a substituted of the clip Property,
I'm using following the code(take from www.w3schools.com);

<html>
<head>
<style type="text/css">
img 
{
position:absolute;
clip:rect(0px 50px 200px 0px)
}
</style>
</head>

<body>
<p>The clip property is here cutting an image:</p>
<p><img border="0" src="bookasp20.gif" width="120" height="151"></p>
</body>

</html>

I'm having problems with this properties in certain browsers, I was wandering if there is a another property or a workaround that I can reach the same effect without using the clip property.
Thanks in advanced :'(

dev.cplusplus 0 Junior Poster in Training

Hi to all, it's been a long time since the last time I participated in the forum, I hope everybody are OK.
I need your help with the following issue:
I have a DLL that is used in a Web Application (ASP not APS.NET) and I need to debug it.
The problem is that the browser is in a remote machine, I need to reproduce a certain problem, that occurs only in this specific machine.
I debug locally like:
In the Project Properties->Configuration Properties->Debugging->Local Windows Debugger->Command
I choose Internet Explorer, and when I get to the part where the dll is used in the web application, my breakpoints are enable and I'm ready to debug.

I noticed that in this part I have the option:
In the Project Properties->Configuration Properties->Debugging->Remote Windows Debugger.
What is this option for?
It's possible to do what I'm trying ?
Do you have any Ideas?

I'll explain in a better way(I hope):
I need a browser from a Remote machine, to use a DLL that is situated in my local machine(project) and Debug it
Thanks in Advanced :'(

dev.cplusplus 0 Junior Poster in Training

Hi to all I new in the programing in JavaScript and get the following problem.
I want to debug my code in VS2005. For IE if I write the line

debugger;

and open the IE browser, I can debug in VS2005. But of course for Firefox is not working.
I try using the Firebug extension in Firefox, but no always work like I want.
I was wandering if you know a way to Debug Firefox with VS2005.

Thanks in advanced:)

dev.cplusplus 0 Junior Poster in Training

Hi to all, I need to write an application, I don't if it possible, but the application needs to receive and URL address and save the web pages(including its resource).
I explain my self:
1. User insert the address: http://www.yahoo.com, http://www.msn.com, http://www.google.com for example
2. The application will download the web sites, the application will also download all the resources of the web site.
3. In the end the user will have a folder with the html file and its resources
4. The user can view the web site off line without need an internet connection

It's like doing the 'Save Page As...' from thh File->Save Page As...
I need to save a lot of web pages, so I don't want to repeat the save action hundred of times


The application will download the 3 web sites.

I found the code in the MSDN

string remoteUri = "http://www.contoso.com/library/homepage/images/";
            string fileName = "ms-banner.gif", myStringWebResource = null;
            // Create a new WebClient instance.
            WebClient myWebClient = new WebClient();
            // Concatenate the domain with the Web resource filename.
            myStringWebResource = remoteUri + fileName;
            Console.WriteLine("Downloading File \"{0}\" from \"{1}\" .......\n\n", fileName, myStringWebResource);
            // Download the Web resource and save it into the current filesystem folder.
            myWebClient.DownloadFile(myStringWebResource,fileName);        
            Console.WriteLine("Successfully Downloaded File \"{0}\" from \"{1}\"", fileName, myStringWebResource);
            Console.WriteLine("\nDownloaded file saved in the following file system folder:\n\t" + Application.StartupPath);

The below code can download specificity files, not all …

dev.cplusplus 0 Junior Poster in Training

Hi to all, I was wandering if I can do the following thing:
I need a page that I can input a piece of script:
e.g.

<script>
function Test(mystring)
{
if (mystring !="")
alert("OK");
else
alert("NotOK");
}
</script>

And click a button and run the script in the page.
The Script can be anything.

I found a way to insert a script in my page like

//mydiv is the place were I want to inser the page
var ni = document.getElementById('myDiv');
//create script object
var element = document.createElement('script');
//set attribute src with the script I insert
element.setAttribute("src",strScript);
ni.appendChild(element);

The problem is that the above piece code insert the script in the page, but doesn't run it.
I can see that the script was added, but nothing happens
Help, Thanks

dev.cplusplus 0 Junior Poster in Training

I'm using getStyles, but if I request the 'border-width' property of the element, I'm receiving 'thick', but I want to know what is 'thick' in pixel or cm or some value I can use, 'thick' doesn't help me to situated floating objects:

border-style: solid;
border-width: thick

Thanks

dev.cplusplus 0 Junior Poster in Training

Hi, I have the following problem I hope someone can help me
I have the CSS file

#one
{
border-style: solid;
border-width: 5px
}
#two
{
border-style: solid;
border-width: thick
}
#three
{
border-style: solid;
border-width: thin
}
#four
{
border-style: solid;
border-width: medium
}

and the HTML file

<table>
<tr>
<td id='one'><div id='uno'>border-width: 5px</div></td>
<td id='two'><div id='dos'>border-width: thick</div></td>
<td id='three'><div id='tres'>border-width: thin</div></td>
<td id='four'><div id='cuatro'>border-width: medium</div></td>
</tr>
</table>

As you can see every div has a different border width that is from the CSS file, I want to know what is "border-width: thick" in pixels, cm or some number not in words. I read the explanation I found in the WEB:
thin - Defines a thin border
medium/Default - Defines a medium border
thick - Defines a thick border
Sometimes I need to situated floating objects according to its border so I need to know what is a thin/thick/medium border in numbers.

dev.cplusplus 0 Junior Poster in Training

Hi to all, I'm new in the forum and also new in the JavaScript programing.
I have the following problem, I have a table that has another table inside one of its elements, the inside table is affected with one property that is in a CSS file. I hope I explain it OK(here is a piece of the code).

<body>
<table bgcolor="#000000">
<tr>
 <td valign='top' id='test'>
	<table width='100%' border='0' cellspacing='0' cellpadding='0'>        
		<tr valign='middle'>
		<td>
			<div>This is some text</div>
		</td>
		</tr>
	</table>
</td>
</tr>
</table>

My problem: I need to take the name of the property that is affecting the inside table, I don't know the name of the property(here in the example is 'test'), I need to provide a solution that is dynamic, the name of the property is no always the same(not always 'test').
I was thinking in a solution but I get stuck, I was thinking to take the property of the parent of the object, but also I don't know how many parents my objects has.
I hope you can help me, and I hope I explain my problem OK

dev.cplusplus 0 Junior Poster in Training

Hi to all, I have the following request/question:
I’ll tell my history: I’m working in a company like a C++ programmer (for almost a year), lately I feel like I’m not going forward professional talking. I’ll explain myself: I receive assignments like fix BUGS or write small functions in the projects.
I was wandering if you have ideas/tutorials/books you can recommend how I can improved my programming. I’m looking for something like a tutorial that will have a subject and then exercises and how to improve it. I know this will required for me a bigger effort to work and study in my free time, but I’ll willing to invest all my time to be a better programmer.
Thanks in advanced :?:

dev.cplusplus 0 Junior Poster in Training

Hi to all I'm writtting a small application, that one of its options will be delete Internet Temporary Files(Cache of IE).
I try deleting the files but without any success. I found an example of code in the web, but when I use the code I receive a error that I don't have the permissions.
This is the code I'm using, I hope you can help me

void ClearFolder(DirectoryInfo folder)
{
      foreach (FileInfo file in folder.GetFiles())
      { file.Delete(); }
      foreach (DirectoryInfo subfolder in folder.GetDirectories())
      { ClearFolder(subfolder); }
}

And call the method like:

ClearFolder(new DirectoryInfo(Environment.GetFolderPath(Environment.SpecialFolder.InternetCache)));

:'(
Thanks

dev.cplusplus 0 Junior Poster in Training

Hi to all, I hope uyou can help with the following situation i have:

I have to write a function that receives a parameter, that is unknow until runtime, meaning one of the parameters could be:
CString, int, double, bool or something else
The function receive additional parameters that are know and one that is unknow, for example:

void MyMethod(char *Mychar, int MyInt, <UnKnow Type> MyUnknowType);

Is possible to write this kind of functions?
I try using the Template like

template <class T>
void MyMethod (char *Mychar, int MyInt, T MyUnknowType) 
{
  Do Something
  memberclass = MyInt;
}

The problem is that the function has to use a data member of my class and the (template)method dot reconized that variable member.
And I don't want to rewrite all the class like template only for one function
Thanks

dev.cplusplus 0 Junior Poster in Training

The Problem is using the method

g.DrawString("Text in Picture", new Font("verdana", 12), SystemBrushes.WindowText, 0, 0);

I put the settings for visual appearance in remarks and still get the same problem.
When not using the method DrawString and only saving the file with Bitmap.save the picture stay with the same size.
Why the method DrawString is resizing my picture?
Thanks

dev.cplusplus 0 Junior Poster in Training

Hi to all I hope you can help with the following issue I have, thanks in advance.
I'm working in an application that insert text to pictures.
The problem is that after inserting the text, the size of the new pictures is smaller(in KB). I'll explain myself the original picture its size is 468KB and after inserting the text the new picture has the size 93KB. I'm wandering why the picture is smaller, I'm guessing I'm loosing quality or something else, but I don't know what (BTW the picture stay with the same dimensions (1024x768)).
This is the code I'm working to insert the text

Bitmap bitmap = new Bitmap(@"C:\pics\mypic.jpg");
Graphics g = Graphics.FromImage(bitmap);
//Set quality to High
g.CompositingQuality = CompositingQuality.HighQuality;
g.SmoothingMode = SmoothingMode.HighQuality;
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
//String to draw in Picture
g.DrawString("Text in Picture", new Font("verdana", 12), SystemBrushes.WindowText, 0, 0);
//New name of the new picture with text
bitmap.Save(@"C\pics\mypicwithtext.jpg", bitmap.RawFormat);

Thanks

dev.cplusplus 0 Junior Poster in Training

Hi to all, I was wandering which is the best way to found the closer number in an array. OK not exactly the closer number, I explain my self:
For example I have the array:
Index: 0 1 2 3
Numbers: 750 500 300 200

* If I receive the number 730, I should return 500(or index 1)
I should return 500 because 730 is smaller that 750

* If I receive the number 750 or 760, I should return 750(or index 0)
I should return 750 because 760 is bigger that 750

* If I receive the number 100, I should return nothing (or index -1)
I should return nothing because 100 is smaller that 200

I look into the search techniques and I didn't found any that work this way.
I search for the number in a linear way, there is a better way.
I did the following:

for (int i=0; i<array.size;i++)
  {
  if(valuetoSearch >= array[i])
  {
  value= array[i];
  break;
  }
  }
dev.cplusplus 0 Junior Poster in Training

Thanks, I use "OpenRemoteBaseKey" and is working fine

dev.cplusplus 0 Junior Poster in Training

Also if you have administrator permissions? Remember I'm talking remote severs that I have administrator permissions
Thanks

dev.cplusplus 0 Junior Poster in Training

Hi, I new in this forum, I have a little experience with C#.
I need to write an application that can add/delete registry keys in a remote server.
I'll explain my self. I working in a company that have a lot of servers and sometimes we need to add/delete keys to the servers, currently this is made manually, but this time a lot of time.
I want to write an application that, I can tell it to with remote server to insert/delete the key.
Is this possible? I found examples to add/delete registry keys, but in a local machine.
Thanks for your help

dev.cplusplus 0 Junior Poster in Training

Hi, I was wandering if someone, can recommend a tool that does reverse engineering
I have the following problem: I have a project in C++, with a lot of classes and a lot of inheritances, I want to learn all the classes and inheritances, and If I can receive the class diagram can make my learning a little more shorter.
Thanks
:cheesy:

dev.cplusplus 0 Junior Poster in Training

Hi, first you have a problem in the operator '+',

Matrix C(dim1,dim2);

You try to use a constructor with two paramenters and you have a constructor only with one parameter.
The reason why the constructor is called before you can return it, is because you are in the end of the method '+', so the life of the temporary object in the '+' ends, when the return is called, the destructor was already called.

dev.cplusplus 0 Junior Poster in Training

Hi, I have two questions:
1. I receive a project and I noticed that when I want to compile I have the following options:
Debug
Release
Release MinDependecy
Release MinSize
I know only Debug and Release, what are the other options?
What are the meaning when compiling with this options?
2. I have another project a DLL project, How I can Debug it?
When I run start debuging, I receive a window that is written:
----------------------------------------------------------------------
Executable For Debug Session
PLease specify the name of the executable file to be used for the debuf session.
Executable file name:
URL where the project can be accessed(ATL Server only):
----------------------------------------------------------------------
Thanks :eek:

dev.cplusplus 0 Junior Poster in Training

I saw an example in the web with the following example:

int *int_array = new int [10];
MyFunc(&int_array);

The problem is that I can't use

int *int_array = new int [10];

So I'll try something else
Thanks

dev.cplusplus 0 Junior Poster in Training

Hi again, I have the following question,
I have the following problem:
I have an array and a function that receives the array, the problem is that the function is declared like this

void MyFunc(int **my_array)
{
for ( i=0; i<10; i++)
        (*my_array)[i] = 0;
}

And when I use the function I receive error:

int int_array[10];
MyFunc(int_array);

I must implement the function with "**" and I must use an array like int int_array[10];, it is possible to send the array to the function?
Any Ideas?
Thanks

dev.cplusplus 0 Junior Poster in Training

Hi I to all I have the following question, I hope you can help me:
I need to store variables, in diferent variable types, but I want to know for example the size of the int type what size of number I can store, I found that int can store 4 bytes, but I don't undertand what size is this?
I found the following explination, with all the sizes.
http://msdn2.microsoft.com/en-us/library/cc953fe1.aspx
My question is if I have an integer, and its writen 4 bytes how it look the number in decimal.
Thanks

dev.cplusplus 0 Junior Poster in Training

Thanks for the quick reponses,
I found a solution, store the value in a ULONGLONG variable and use the "_atoi64" method

ULONGLONG nBigNumber = _atoi64(pi_sString);
dev.cplusplus 0 Junior Poster in Training

Hi, to all, I'm having the following problem:
I'm trying to convert a CString to long(or number), but the number that is in the Cstring is too big and I loose data of the number.
I was thinking in using instead of long use the variable ULONGLONG, but the problem is that I don't know if there is Build-in method that converts Cstring to ULONGLONG.
Any ideas, how I can solve this problem, convert a big number stored in a CString and save it in a variable number.
I try this but is not working

CString pi_sString = ''1099511627775";
long nNumber = atol(pi_sString);

Thanks :rolleyes:

dev.cplusplus 0 Junior Poster in Training

Thanks but it wasn't wht I'm looking for
I try the following

DATE MyTime = COleDateTime::GetCurrentTime();    
COleDateTimeSpan  MyDiff = CurrentTime;
//Convert the seconds to milliseconds 
DWORD Milliseconds = ( timeDiff.GetSeconds() * 1000);    
Milliseconds = Milliseconds + 10000;

I try to add '10000' milliseconds to the value that pass, but when I set the value "Milliseconds", I think the value is too big and I receive a smaller value that is smaller.
What I can do?
I really need your help

dev.cplusplus 0 Junior Poster in Training

hi, I have the following problem, I working with the variable "COleDateTime".
I have the following code:

DATE CurrentTime = COleDateTime::GetCurrentTime();

This returns the current time of the system
Do you know how to add to this current time seconds, minutes, days?
Also I need to get two dates and make some actions, How many seconds, days.. pass('+', '-'),
Ideas?
:eek:
Thanks

dev.cplusplus 0 Junior Poster in Training

Thanks for the qick answers:
1. We prefer not use external libraries, but thanks
2. What do you mean "This of course would require some minor redesign every time your counter is accessed in the code"?
Thanks again

dev.cplusplus 0 Junior Poster in Training

Hi, we have the following problem:
We have a code that uses the "GetTickCount" method (the return value is the number of milliseconds that have elapsed since the system was started).
The Problem:
Since GetTickCount returns only a 32-bit number, after about 49 days, the counter wraps.
The solution we thoung is the following:
Use the "COleDateTime::GetCurrentTime", but the problem is that this method returns the value for example like: 9411.22222 (double variable)
and we need the value in DWORD so when we set the value in the variable we lost all the date after the '.', we will receive the value "9411".
Any Ideas?
How to resolve this?
Thanks :eek:

dev.cplusplus 0 Junior Poster in Training

Hi, we are trying to find the best IIS tunning for our server.

1. Server works with ISAPI extension (without ISAPI filter)

2. Server doens't receive asp pages in the request, we receive the request like:
www.myserver.com/mydll.dll?param1=1&param2=2

3. The ISAPI was written in VS2005

Is there some recomended settings for IIS with this settings, we know of course that after changing the setting, we will need to check if the performanced was improved.

Thanks

dev.cplusplus 0 Junior Poster in Training

Thanks, for your answers. I found a very good article, how to profile an ISAPI extension, but is written for VS6 and I'm working with VS2005, somebody know how to do what is writen in the article but in VS2005?
http://www.codeproject.com/isapi/profiling_isapi.asp
Or How I can profile my application in VS2005?

dev.cplusplus 0 Junior Poster in Training

Hi to all, I don't now if this is the rigth place, but I will ask anyway.

I'm trying to improve the performance of my ISAPI application (written in C++), I'm looking for information to read in the web but I dind't found much,
I was wandering I you have some tips or web site you can recomend.
BTW:

I'm working with Visual Studio 2005
My ISAPI extension is working in IIS6


Thanks :mrgreen:

dev.cplusplus 0 Junior Poster in Training

Hi to all, I need your help, I need to sort a CList, I was wandering if you can help me in this issue.
Wich is the best way to sort CList and How to manage the pointer?
Thanks :rolleyes:

dev.cplusplus 0 Junior Poster in Training

:mrgreen:
Hi to all, I have a challange in my work, we have a project that uses a variable of type "CMapStringToPtr", this object is use to store some data, now we want to change the type to more efective type, the problem is that we need to know if a value was change and put it in the first place of the list, I was thinking using "Linked List", if I value was changed, dleted the current value and put it in head of the list.
I was wandering is linked list the best solution?
Do you have any suggestion of Data Structures, we can use?
we have are saving something like this:
key, value

key value key value key value
1 1------>2 4------>4 6

Now for example key "2" its value is change to 1, now the list should be like:
key value key value key value
2 1------>1 1------>4 6
In the head of the list should be the last object(key) that was changed
Thanks

dev.cplusplus 0 Junior Poster in Training

I noticed that the variable receive the rigth number, according to the table of unicode characters, provably the problem is storing the character, is possible to convert the number to the letter?
Thanks

dev.cplusplus 0 Junior Poster in Training

Hi again, after I long time I return working inmy unicode-encoding project, I was very exciting because I try the answer you gave in Visuak Studio 2005 and works great, but then I build another project (new) with visual studio6(old version) and I take the function, but seems that in visual studio6 doesn't work, is this possible?
I set my project adding Unicode support for visual studio 6 like is writen in: http://www.differentpla.net/node/135
but when Idebug the program or write the letter in a file that supports unicode I see that is not the same letter.

Again Help
* You can see the attached picture, to understand what I talking about
:eek: