GTAMP.com

Grand Theft Auto Media Press
It is currently Sat May 25, 2013 3:18 am

All times are UTC




Post new topic Reply to topic  [ 345 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7 ... 18  Next
Author Message
PostPosted: Sat Feb 13, 2010 10:56 pm 
Offline
User avatar

Joined: Fri Apr 24, 2009 9:43 pm
Posts: 415
Location: Estonia
Sorry, i found that my IntToString doesn't work for license plates.
I don't know why. If you generate the plates it will display that file not found.

Can you debug this part by yourself?
Something goes wrong in there.
If it doesn't start working, use your old version of IntToString.


Top
 Profile  
 
PostPosted: Sun Feb 14, 2010 6:02 am 
Offline
Boss
User avatar

Joined: Tue Mar 04, 2008 6:51 am
Posts: 981
Location: GTAMP.com
Try ShellExecute and SW_HIDE.


Top
 Profile  
 
PostPosted: Sun Feb 14, 2010 8:46 am 
Offline
User avatar

Joined: Fri Apr 24, 2009 9:43 pm
Posts: 415
Location: Estonia
Of course, Sektor is correct.
I was wondering why all the mess around "system()".
Is there any particular reason why you use it?

As Sektor said, you can execute almost anything you want with ShellExecute and you can control it's window, command line etc.
Hide it, maximize it, show it as it is and so on.

Read more about it here:
http://msdn.microsoft.com/en-us/library ... 85%29.aspx


Top
 Profile  
 
PostPosted: Sun Feb 14, 2010 8:33 pm 
Offline
User avatar

Joined: Fri Jan 29, 2010 3:03 pm
Posts: 795
B-$hep wrote:
Of course, Sektor is correct.
I was wondering why all the mess around "system()".
Is there any particular reason why you use it?

As Sektor said, you can execute almost anything you want with ShellExecute and you can control it's window, command line etc.
Hide it, maximize it, show it as it is and so on.

Read more about it here:
http://msdn.microsoft.com/en-us/library ... 85%29.aspx


I only use system() because that worked with version 2 and the other ones I tried never freaking work. Always some kind of weird error. It seems that I'm actually working now with .NET and C++ at the same time. The GUI functions in Visual Basic 2008 is from .NET, I didn't know that, I just used it. Learning C++ and .NET at the same time is confusing, for example, the stupid System::String^ isn't native/normal C++ is it?

To be honest, I cannot get the ShellExecute working... :cry:

I add #include <shellapi.h> and ShellExecute(NULL, "open", "imagemagick\\convert.exe", NULL, NULL, SW_SHOWNORMAL);
And what do I get: error LNK2001: unresolved external symbol "extern "C" struct HINSTANCE__ * __stdcall ShellExecuteA(struct HWND__ *,char const *,char const *,char const *,char const *,int)" (?ShellExecuteA@@$$J224YGPAUHINSTANCE__@@PAUHWND__@@PBD111H@Z)

_________________
"Only Silky Milky implants by Zaibatsu feel and taste like the real thing."


Top
 Profile  
 
PostPosted: Sun Feb 14, 2010 8:41 pm 
Offline
User avatar

Joined: Fri Apr 24, 2009 9:43 pm
Posts: 415
Location: Estonia
You forgot to link shell32.lib.
Under Project->Properties choose Linker.
Then you will see Command Line.
Click on it. Then you will see empty white box on the window.

Type this in: shell32.lib
Click OK and build EXE again.


Im using VC++ Express but the project options window should be same.


Try this, if doesn't work, let me know.


EDIT: you said .NET and C++. So you actually use managed C++ and not the native WIN32 one?

When you started working on GUI version of your tool, what project did you created with VS Wizards?


CLR->Windows Forms Application ?
Or Win32->Win32 Project?


Top
 Profile  
 
PostPosted: Sun Feb 14, 2010 9:11 pm 
Offline
User avatar

Joined: Fri Apr 24, 2009 9:43 pm
Posts: 415
Location: Estonia
OK, as it turned out that it's a managed C++ and you can't use the usual ShellExecute.

You could use Process::Start method
http://msdn.microsoft.com/en-us/library ... start.aspx

Code:
Process::Start("IExplore.exe");


http://msdn.microsoft.com/en-us/library ... 71%29.aspx
Read the whole page, it has info about command line also.

But i don't see any chance to hide the window. Probably you could send message to window (SW_HIDE).

But first try to make it work for you and worry about hiding flashing console window later.

EDIT: almost forgot. You must add this to the top of your code:
Code:
using namespace System::Diagnostics;


Top
 Profile  
 
PostPosted: Mon Feb 15, 2010 6:22 pm 
Offline
User avatar

Joined: Fri Jan 29, 2010 3:03 pm
Posts: 795
New color system is getting shape.

Example text input: [1]Cuban-Pete [5]likes [7]fast [15]cars and [10]woman!

Output:
Attachment:
result.png
result.png [ 2.3 KiB | Viewed 1049 times ]

_________________
"Only Silky Milky implants by Zaibatsu feel and taste like the real thing."


Top
 Profile  
 
PostPosted: Mon Feb 15, 2010 9:47 pm 
Offline
User avatar

Joined: Fri Jan 29, 2010 3:03 pm
Posts: 795
Anybody any idea how to convert System::String^ to std::string? I use string to get into system(), but the user input is in System::String^.

Do you guys also perhaps know why running my program the first time (after computer restart) takes pretty long, but the next time it goes very quick? How can I fix that?

_________________
"Only Silky Milky implants by Zaibatsu feel and taste like the real thing."


Top
 Profile  
 
PostPosted: Mon Feb 15, 2010 9:54 pm 
Offline
User avatar

Joined: Fri Jan 29, 2010 3:03 pm
Posts: 795
I fixed the string thing, perhaps a bit "ugly", but it works:

Code:
string SystemToString(String ^blabla){
   int lenght = blabla->Length;
   string realString = "";
   for (int i=0; lenght > i; i++){

   realString += char(int(blabla[i]));
   };
   
   return realString;
};

_________________
"Only Silky Milky implants by Zaibatsu feel and taste like the real thing."


Top
 Profile  
 
PostPosted: Mon Feb 15, 2010 10:54 pm 
Offline
User avatar

Joined: Fri Jan 29, 2010 3:03 pm
Posts: 795
I fcked it all up, just when I was almost at the end. I removed a resource image in the (resX?) by hand (I just needed to update the preview image) and now I get LNK2005 error's... this really sucks. Do you guys know a way to find the problem by hand?

What I did was rename an image to "222" and added a new one, but removed the "222" again or something like that...

:cry: :cry:

_________________
"Only Silky Milky implants by Zaibatsu feel and taste like the real thing."


Top
 Profile  
 
PostPosted: Tue Feb 16, 2010 1:06 pm 
Offline
User avatar

Joined: Fri Apr 24, 2009 9:43 pm
Posts: 415
Location: Estonia
Damn, so many posts here already. Didn't notice.

What errors exactly? How many of them?


Top
 Profile  
 
PostPosted: Wed Feb 17, 2010 10:11 am 
Offline
Boss
User avatar

Joined: Tue Mar 04, 2008 6:51 am
Posts: 981
Location: GTAMP.com
I finally got around to trying this program. It's cool.

I used it to generated some text for this page.


Top
 Profile  
 
PostPosted: Wed Feb 17, 2010 10:39 am 
Offline
User avatar

Joined: Fri Jan 29, 2010 3:03 pm
Posts: 795
Sektor wrote:
I finally got around to trying this program. It's cool.

I used it to generated some text for this page.


Thanks. The page looks nice.

_________________
"Only Silky Milky implants by Zaibatsu feel and taste like the real thing."


Top
 Profile  
 
PostPosted: Wed Feb 17, 2010 1:45 pm 
Offline
User avatar

Joined: Fri Apr 24, 2009 9:43 pm
Posts: 415
Location: Estonia
How is your work on GUI or this tool going?
If you have some problems, post them here.


Top
 Profile  
 
PostPosted: Wed Feb 17, 2010 6:02 pm 
Offline
User avatar

Joined: Fri Jan 29, 2010 3:03 pm
Posts: 795
It's going good.

Only small problem with a function, you can only check the System::Object^ sender with the real name and not a string.
I also wanted to do colouring in richTextBox, but I don't get that working. I can make for example "[0]" to grey color, but if there is another [0] in the richtextbox, I can't get it....

_________________
"Only Silky Milky implants by Zaibatsu feel and taste like the real thing."


Top
 Profile  
 
PostPosted: Wed Feb 17, 2010 7:32 pm 
Offline
User avatar

Joined: Fri Jan 29, 2010 3:03 pm
Posts: 795
Code:
            if (this->radio_large->Checked == true){
               this->example_large->Visible = true;
               this->example_normal->Visible = false;
               this->example_menu->Visible = false;
               this->example_street->Visible = false;
               this->example_car->Visible = false;
            };


This is not very efficient if you do it 5 times, is there better way?

_________________
"Only Silky Milky implants by Zaibatsu feel and taste like the real thing."


Top
 Profile  
 
PostPosted: Wed Feb 17, 2010 7:47 pm 
Offline
User avatar

Joined: Fri Apr 24, 2009 9:43 pm
Posts: 415
Location: Estonia
What are they?
Buttons? Labels? Checkboxes?


You could all hide all at once with simple panel.
Put panel on the top of the controls and hide / unhide just this panel.

_________________
Always wear safety glasses while programming.


Top
 Profile  
 
PostPosted: Wed Feb 17, 2010 7:55 pm 
Offline
User avatar

Joined: Fri Jan 29, 2010 3:03 pm
Posts: 795
They are images.

I have no idea about cleaning up strings/integers. Is that necessary? (garbage collection?)

_________________
"Only Silky Milky implants by Zaibatsu feel and taste like the real thing."


Top
 Profile  
 
PostPosted: Wed Feb 17, 2010 7:58 pm 
Offline
User avatar

Joined: Fri Apr 24, 2009 9:43 pm
Posts: 415
Location: Estonia
.NET has garbage collector, you don't need to mess with that.
It automatically collects garbage.


But where are your images? On the main form?

_________________
Always wear safety glasses while programming.


Top
 Profile  
 
PostPosted: Wed Feb 17, 2010 8:03 pm 
Offline
User avatar

Joined: Fri Jan 29, 2010 3:03 pm
Posts: 795
yeah, they are example images of the font the user selected.

I thought perhaps this is possible (but it did not work):

this->example_car->Visible, this->example_normal->Visible = false;

_________________
"Only Silky Milky implants by Zaibatsu feel and taste like the real thing."


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 345 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7 ... 18  Next

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group