emanfman 17 Newbie Poster

Hey.

Windows 7 x86. 4GB RAM. 500GB HDD.

Bluescreens every other time coming out of standby/hibernate.
Only pointing to Windows kernels... but there's gotta be another reason.
STOP 0xE1, in case you were wondering.
All dumps attached.

Thanks,
Emanfman

emanfman 17 Newbie Poster

Sorry for taking a while to reply, this was pretty far down on my to-do list, but I got to it! (See, you ARE important!)

Caperjack: No, it works with everything.

Hotmatrixx: One question before I do this...
What do you mean "will only work in safe mode," will it still work afterwards?
And do I really need to import the .reg? Or will the .dll just be enough?

-Emanfman

emanfman 17 Newbie Poster

*bump*

P.S. Is that allowed? I sure hope so...

emanfman 17 Newbie Poster

If you are not the administrator, then you can't edit system files. It's that easy. Microsoft does this to make sure a non-administrative person cannot mess around with the system files. Sorry, but that's the truth. And I think that Microsoft's tech geekies are slightly more intelligent then the people offering help here, myself included. If there were a way to bypass it, then many, many computers would be hacked, compromised, and infected with viruses.

Just my two cents. I did not intend to offend anyone, and I tried not to provide a biased opinion. If I have done either, let me know, and I'll edit my answer.

-Emanfman

emanfman 17 Newbie Poster

I am not using a Virtual Machine, and I did not have a previous version of windows installed on my PC.

Please clarify; I can use Windows Aero Themes with no problem, but why is the system32 folder opening? Why isn't the task executing? And how can I fix it?

emanfman 17 Newbie Poster

I have never seen anything better than TeamViewer 6 for this job.
I know, I'm the millionth person to tell you this.
And by the way, I'm pretty sure windows already has a remote desktop connection feature built in...

Hope I helped... albeit not much more than anyone else :P
-Emanfman

P.S. I don't think LogMeIn is the best thing to use... it's a bit complicated, and expensive, too - but it is still an option...

emanfman 17 Newbie Poster

Did you remove them from the recycle bin? :P

Anyways, one such program that I prefer is Brian Kato's restoration utility because it received many positive reviews from PCWorld Magazine. It showed me files I didn't even know I had!

Link: http://www.pcworld.com/downloads/file/fid,23108-order,4-page,1/description.html

MAKE SURE YOU RIGHTCLICK->RUN IT AS AN ADMINISTRATOR!

I hope this helps!
-Emanfman

emanfman 17 Newbie Poster

Permissions aren't set to allow the program to edit the contents of the folder.
This can be changed easily, but be wary that when you allow this program to edit your system files, you allow ANYTHING to edit your system files.

OR

You can simply right-click->Run this program as an administrator. It will ask if it can make changes to your computer, to which you can say yes. This is a much more secure option. ;)

Hope this helps!
-Emanfman

emanfman 17 Newbie Poster

Hey... something I've always wondered.

For some reason, one day, this stopped working for me.

When you right click (or click drag upwards) an icon of a running program in Windows 7, you get a menu. By default, there is a section in that menu marked "tasks" which allow you to manipulate the program without actually bringing up the window. For example, with Skype, the menu reads:

Tasks-------------------------------------
Sign out
Quit Skype
------------------------------------------
Launch Skype
Pin this program to taskbar
Close Window

Whenever I click "Pin ... taskbar" it does just that. But when I click an option in the "tasks" section, it opens windows explorer into my C:\Windows\system32 directory (and does nothing else). Any idea why this is happening? How can I fix this?

Thanks,
-Emanfman

emanfman 17 Newbie Poster

It executes line 3 and 4 over and over again:

cd "C:/"
md "PC Killar"
cd "C:/"
md "PC Killar"
cd "C:/"
md "PC Killar"
cd "C:/"
md "PC Killar"
cd "C:/"
md "PC Killar"
..etc...

I wouldn't really call that a virus. Just a nuisance batch file.

I knew that... But what is PC Killar?

emanfman 17 Newbie Poster

Well, well. I was looking for a program online. And so, it appeared as a .bat file. However, It looked suspiciously small at 53 kB. So, before I ran it, I opened it up in notepad and voila, a virus. So, I shredded the file with the windows 7 shredder, but not before copying the code. Can someone tell me what this code snippet would do?

@echo off
:loop
cd "C:/"
md "PC Killar"
goto loop

Whatever you do, don't run it in command prompt!
Just let me know what would happen.

Thanks,
Emanfman

emanfman 17 Newbie Poster

So... should I mark this as solved?

If so - the final result of this thread is that the std::string and System::String^ classes are not compatible.

And the fixed file from the original thread post is as follows:

#include "stdafx.h"
using namespace System;

String ^Convert(String ^OriginalText) {
array<String ^> ^Array = gcnew array<String ^>(13){ "", "", "", "", "", "", "", "", "", "", "", "", "" };
String ^ConvertedText;
 
for (int Loop = 0; Loop < 13; Loop++)
{
	ConvertedText += Array[Loop];
        ConvertedText += "\r\n";
}
return ConvertedText;
}

This is for C++/CLI with Common Language Runtime Support (clr). I suggest using std::string for a console application! I am using a Windows Form.

emanfman 17 Newbie Poster

Side note: newline character fixed, just needed a \r before it... silly me. :P

emanfman 17 Newbie Poster

Don't have a link, but this compiles and runs perfectly.

String ^ParseBBCode(String ^OriginalText) {
array<String ^> ^Array = gcnew array<String ^>(13){ "\n", "Hello", "\n", "World", "", "", "", "", "", "", "", "", "" };
String ^ConvertedText;

String ^Line1 = "";

for (int Loop = 0; Loop < 13; Loop++)
{
	ConvertedText += Array[Loop];
}

EDIT: Newline character isn't working. Perhaps help? Maybe '\n'.toString()?

Ancient Dragon commented: nice example code. +17
emanfman 17 Newbie Poster

Yes, but I'm using System::String^ and not std::string - With System::String^ the += operator is supported, but defining my array is different.

emanfman 17 Newbie Poster

Fixed, thank you.
Array defined slightly differently.

emanfman 17 Newbie Poster

Hi,

I am really confused. Everywhere I read on the internet, I see that the += operator is part of the string class. I want to add something onto the end of the string. Why does my code not compile? I keep getting the C2088 error: illegal for class.

If the solution has to be completely redone, here is the file:

#include "stdafx.h"
#include <string>
using namespace std;
using namespace System;

String ^Convert(String ^OriginalText) {
string Array[13];
String ^ConvertedText;

for (int Loop = 0; Loop < 13; Loop++)
{
	ConvertedText += Array[Loop];
	ConvertedText += '\n';
}

return ConvertedText;
}

I just took out the unnecessary bits. Do I need a variant of the concat function? Please help!

emanfman 17 Newbie Poster

Thank you, that helped. However, I must say I made my own modifications after some debugging errors popped up. Here is the finished product, for the knowledge base.

/*-----xxx.cpp-----*/

#include "stdafx.h"
#include <string>
using namespace std;
using namespace System;

String ^ParseBBCode(String ^OriginalText) {
String ^ConvertedText;

//MANIPULATION OF TEXT

return ConvertedText;
}
/*-----xxx.h-----*/
System::String ^ParseBBCode(System::String ^OriginalText);
/*-----Form1.cpp-----*/
#include "stdafx.h"
#include "Form1.h"

using namespace Form1;

[STAThreadAttribute]
int main(array<System::String ^> ^args)
{
	// Enabling Windows XP visual effects before any controls are created
	Application::EnableVisualStyles();
	Application::SetCompatibleTextRenderingDefault(false); 

	// Create the main window and run it
	Application::Run(gcnew Form1());
	return 0;
}
/*-----Form1.h-----*/
#include "Function Linker.h"
#pragma once

namespace Form1 {

	using namespace System;
	using namespace System::ComponentModel;
	using namespace System::Collections;
	using namespace System::Windows::Forms;
	using namespace System::Data;
	using namespace System::Drawing;

	/// <summary>
	/// Summary for Form1
	/// </summary>
	public ref class Form1 : public System::Windows::Forms::Form
	{/*Form components and designs*/
private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {				 
				 String ^OriginalText;
				 String ^ConvertedText;

				 OriginalText = this->textBox1->Text;

				 ConvertedText = ParseBBCode(OriginalText);

				 this->textBox2->Text = ConvertedText;
				 }

That should be it! Thanks!

emanfman 17 Newbie Poster

Hi emanfman,

I agree with MOST of your post, but the syntax you give for the "if" statement is, while it will probably compile, misleading at best.

There is no multiple conditions separated by commas in an "if" statement. The syntax of the multiple types of "if" statement is as follows:

if ( condition ) statement1;

if ( condition ) statement1; else statement2;

if ( condition )
{
   statement1;
   statement2;
}

if ( condition )
{
   statement1;
   statement2;
}
else
{
   statement3;
   statement4;
}

Only the "for" statement has three parts to it, and they are separated by semicolons and not commas.

Tom

From the near JavaScript example he gave, with the conditions separated by &&, I use a comma because it makes the "if" statement true only if ALL the conditions are true. Technically, it is still correct to use the && though.

emanfman 17 Newbie Poster

You're calling the function in Form1.h, correct? As long as your .cpp file is part of the project, everything should be fine. No, do not move the body of the function to the header.

It's confusing because in the Winforms programs, the Form1.h also contains a lot of definitions. If you have included the one line header in Form1.h, are calling the function in Form1.h, and have the associated .cpp file with the body of the function as a part of the same project, you've done all you need to do.

It's not working for me.

Here is my complete .cpp file.

// Form1.cpp : main project file.

#include "stdafx.h"
#include "Form1.h"
#include "xxx.h"

using namespace Form1;

[STAThreadAttribute]
int main(array<System::String ^> ^args)
{
	// Enabling Windows XP visual effects before any controls are created
	Application::EnableVisualStyles();
	Application::SetCompatibleTextRenderingDefault(false); 

	// Create the main window and run it
	Application::Run(gcnew Form1());
	return 0;
}
String ^ParseBBCode(String ^OriginalText) {
String ^ParsedBBCode
//manipulate OriginalText and assign to ParsedBBcode
return ParsedBBCode;
}

Here is xxx.h:

String ^ParseBBCode(String ^OriginalText)

Here is Form1.h, with the design bits excluded:

#include "xxx.h"
#pragma once

namespace Form1 {

	using namespace System;
	using namespace System::ComponentModel;
	using namespace System::Collections;
	using namespace System::Windows::Forms;
	using namespace System::Data;
	using namespace System::Drawing;

	/// <summary>
	/// Summary for Form1
	/// </summary>
	public ref class Form1 : public System::Windows::Forms::Form{/*FORM DESIGN CODE*/

#pragma endregion

	private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {				 
				 String ^OriginalText;
				 String ^ConvertedText;

				 OriginalText = this->textBox1->Text;

				 ConvertedText = ParseBBCode(OriginalText);

				 this->textBox2->Text = ConvertedText;
				 }
};
}

Is …

emanfman 17 Newbie Poster

Put it in a file named something like "ParseBBCode.h". Include that header in your Form1.h file (or put it in stdafx.h, but that's not necessary). You do not need to include <string>, the String ^ in this case is a System::String^ from .NET.

You will either need to put a using namespace System; at the top of your header (not a good idea, as everything that includes it will now have that namespace) or qualify your String^s in the header as such:

System::String ^ ParseBBCode(System::String^ OriginalText);

Should I move the function from my .cpp to the new .h file? I don't see how my function in the .cpp will be called.

From what I understand, my Form1.h is handling the button1 click. When it calls the function, it is in the included .h file... but what do I do with the actual function in the .cpp?

emanfman 17 Newbie Poster

I saw a major syntax error. Maybe you were thinking Java?

The proper syntax for an if statement is:

if (condition1, condition2, condition3...) {statement1; statement2;}

If it's simpler, here it is on several lines:

if (condition1, condition2, condition3...)
{
statement1;
statement2;
}

If you wanted something to be done if it were evaluated false, just add an else at the end, followed by braced code:

if (condition1, condition2, condition3...)
{
statement1;
statement2;
}
else
{
statement3;
statement4;
}

Notice that the if...else statement doesn't require a semicolon (;) after the braces... it acts like a function.

Try fixing up your code with the right syntax.

Remember - you need the conditions in parentheses (()) and the function in braces({}).

Also, something I just realized is that you have no function for the "if" and the else has no condition.

Hope that helps!

emanfman 17 Newbie Poster

Create a new header file named "xxx.h". Put String ^ParseBBCode(String ^OriginalText); in the new header file. Include it in the file where you call ParseBBCode.

It doesn't seem to work... Which file do I include it in? The .h or the .cpp? Do I need to add an #include <string> at the beginning? Do I need to put that code within a function?

emanfman 17 Newbie Poster

Hi,

I am a little bit troubled.
I want to call a function in a separate file on a windows form.
Here is my header file:

private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {				 
				 String ^OriginalText;
				 String ^ConvertedText;

				 OriginalText = this->textBox1->Text;

				 ConvertedText = ParseBBCode(OriginalText);

				 this->textBox2->Text = ConvertedText;
				 }

This means that when button1 is clicked, two variables are declared. One of them is set to the value in textBox2. Then, I execute the function ParseBBCode(/*string parameter*/) and assigned the returned string to textBox2.

Here is my .cpp file:

String ^ParseBBCode(String ^OriginalText) {
String ^ParsedBBCode
//manipulate OriginalText and assign to ParsedBBcode
return ParsedBBCode;
}

I know I'm missing something, but I don't know what. What do I need to include the function into the header? I have #include <string> in the .cpp file. I can't use #include "xxx.cpp" because it generates about 80 errors. The once I'm stuck with right now is just this one:

error C3861: 'ParseBBCode': identifier not found

Thanks!