|
How would one go about enumerating the string table resources?
I would like to copy the string resources into a table...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.santacruznetworks.com">Santa Cruz Networks</A>
|
|
|
|
|
Peter Weyzen wrote:
How would one go about enumerating the string table resources?
these three api will help:-
EnumResourceLanguages Searches for resources of a specified type and name and passes the language to a callback function.
EnumResourceNames Searches for resources of a specified type and passes the name or the ID to a callback function
EnumResourceTypes Searches for resources and passes each type to a callback function.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Can i use this control?
How?
Thanks!
|
|
|
|
|
What autocomplete control ? In the common file open dialog ? You'd have to subclass the behaviour of the textbox that exists there.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Take a look at the SHAutocomplete function.[^]
Be aware of the minimum OS requirements, though. For example, it won't work in Windows 95 or Windows 98, unless you have Internet Explorer 5 or later. You'd better check for the correct version of shlwapi.dll (5.0 or later) before using this function.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
followait wrote:
Can i use this control?
First You have to Subclass the CFileDialog as Mentioned By Mr Graus and then use SHAutoComplete and related api as mentioned by Mr. Jose!.
Now if you want to know what is Subclassing FileDialog, then here are some link that might help you!
SubClassing[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Hi, Alok
I might be wrong, but I think the file open dialog already implements autocomplete by itself. I think the original poster thought this dialog was using a special control and was asking for a way to use it in his own dialogs. Like in "How can I use the control with autocomplete that is used in file open dialog"?
Cheers,
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Hi Rios,
Jose Lamas Rios wrote:
I might be wrong,
No,NO! you are right Man! I am wrong!
Jose Lamas Rios wrote:
this dialog was using a special control and was asking for a way to use it in his own dialogs. Like in "How can I use the control with autocomplete that is used in file open dialog"?
Yeap You are Right ,I interpreted Question wrong , Now I need More Cofee
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
I am calling CoCreateGuid to get the guid but now I need to take the guid and copy it into a string. I have tried several different ways but nothing is working. So far my code looks like
GUID guidID;
if( S_OK == CoCreateGuid(&guidID) )
{
}
How can I take guidID and copy it into a char string?
|
|
|
|
|
I use this with MFC:
strGUID.Format(_T("%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X"),
guid.Data1,
guid.Data2,
guid.Data3,
guid.Data4[0],
guid.Data4[1],
guid.Data4[2],
guid.Data4[3],
guid.Data4[4],
guid.Data4[5],
guid.Data4[6],
guid.Data4[7]);
In your case, replace strGUID with a char array, and replace Format with sprintf.
In Italy for thirty years under the Borgias they had warfare, terror, murder, bloodshed - but they produced Michelangelo, Leonardo da Vinci and the Renaissance. In Switzerland they had brotherly love, five hundred years of democracy and what did that produce - the cuckoo clock!
-- Harry Lime
|
|
|
|
|
Lookup the following:
StringFromGUID2
StringFromIID
StringFromCLSID
|
|
|
|
|
I have just added a splash screen to my program. i can compile it without errors but when i try to run it the splash screen does not exit and it continually opens the next window, until i endup with about 10 windows and i close the program.
i am not sure what code is causing the problem so i will just post the splash screen form code:
#pragma once
#include "Form1.h"
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
namespace MyProgram
{
public ref class frm_splash_screen : public System::Windows::Forms::Form
{
public:
frm_splash_screen(void)
{
InitializeComponent();
}
protected:
virtual void Dispose(Boolean disposing) override
{
if (disposing && components)
{
delete components;
}
__super::Dispose(disposing);
}
private: System::Windows::Forms::Label^ lbl_splash_screen;
private: System::Windows::Forms::Timer^ timer1;
private: System::Windows::Forms::PictureBox^ pictureBox1;
private: System::ComponentModel::IContainer^ components;
protected:
private:
#pragma region Windows Form Designer generated code
void InitializeComponent(void)
{
this->components = (gcnew System::ComponentModel::Container());
System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(frm_splash_screen::typeid));
this->lbl_splash_screen = (gcnew System::Windows::Forms::Label());
this->timer1 = (gcnew System::Windows::Forms::Timer(this->components));
this->pictureBox1 = (gcnew System::Windows::Forms::PictureBox());
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->pictureBox1))->BeginInit();
this->SuspendLayout();
this->lbl_splash_screen->AutoSize = true;
this->lbl_splash_screen->BackColor = System::Drawing::Color::Transparent;
this->lbl_splash_screen->Font = (gcnew System::Drawing::Font(L"Porky\'s", 36, static_cast<System::Drawing::FontStyle>((System::Drawing::FontStyle::Bold | System::Drawing::FontStyle::Italic)),
System::Drawing::GraphicsUnit::Point, static_cast<System::Byte>(0)));
this->lbl_splash_screen->ForeColor = System::Drawing::Color::Gold;
this->lbl_splash_screen->Location = System::Drawing::Point(110, 105);
this->lbl_splash_screen->Name = L"lbl_splash_screen";
this->lbl_splash_screen->Size = System::Drawing::Size(336, 64);
this->lbl_splash_screen->TabIndex = 0;
this->lbl_splash_screen->Text = L"Splash Screen";
this->lbl_splash_screen->TextAlign = System::Drawing::ContentAlignment::MiddleCenter;
this->timer1->Enabled = true;
this->timer1->Interval = 6000;
this->timer1->Tick += gcnew System::EventHandler(this, &frm_splash_screen::cmd_time_reached);
this->pictureBox1->AutoSize = true;
this->pictureBox1->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"pictureBox1.Image")));
this->pictureBox1->Location = System::Drawing::Point(480, 172);
this->pictureBox1->Name = L"pictureBox1";
this->pictureBox1->Size = System::Drawing::Size(54, 73);
this->pictureBox1->SizeMode = System::Windows::Forms::PictureBoxSizeMode::AutoSize;
this->pictureBox1->TabIndex = 1;
this->pictureBox1->TabStop = false;
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->BackgroundImage = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"$this.BackgroundImage")));
this->BackgroundImageLayout = System::Windows::Forms::ImageLayout::Center;
this->ClientSize = System::Drawing::Size(546, 257);
this->ControlBox = false;
this->Controls->Add(this->pictureBox1);
this->Controls->Add(this->lbl_splash_screen);
this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::None;
this->MaximizeBox = false;
this->MinimizeBox = false;
this->Name = L"frm_splash_screen";
this->ShowIcon = false;
this->ShowInTaskbar = false;
this->StartPosition = System::Windows::Forms::FormStartPosition::CenterScreen;
this->Text = L"frm_splash_screen";
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->pictureBox1))->EndInit();
this->ResumeLayout(false);
this->PerformLayout();
}
#pragma endregion
private: System::Void cmd_time_reached(System::Object^ sender, System::EventArgs^ e)
{
Form1^ frm2 = gcnew Form1();
frm2->ShowDialog(this);
this->Close();
}
};
}
when i run this the splash screen never closes and it continues to open the Form1 form.
Any help is greatly appreciated.
- Kyle
|
|
|
|
|
This is not the MC++ forum, the C++/CLI forum is. Personally, I don't think the splash screen should be responsible for showing the main form, and it can't work in this case, as ShowDialog is a modal call, this->Close won't run until the dialog closes.
If you wanted to stick with this design ( which as I said, is poor in my opinion ), then you could *hide* the splash screen, which will mean it will use memory while your app is running. Or you could change the code so that the main entry point shows the splash screen, and when it closes itself, it goes on to run the main window. However, if there's no thread doing initialisation, why would you waste users time with a splash screen ? Also, I think there's a built in splash screen component.
Can I ask why you're using MC++ ? I'm just interested because I can't imagine ever choosing to use it.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
i am using microsoft visual c++ express editon 2005 and i dont think it has a built in component like that. it was the first way i thought of and i thought it would work but obviously it doesnt.
how would i go about writing the code so that it does it the way that you stated. i dont want it to be using memory the entire time the programs running it would slow it down too much. if you could give me an idea on how to do this it would be greatly appreciated, thank you.
- Kyle
|
|
|
|
|
gr8coaster329 wrote:
i am using microsoft visual c++ express editon 2005 and i dont think it has a built in component like that.
Possibly.
gr8coaster329 wrote:
how would i go about writing the code so that it does it the way that you stated.
The code that creates the splash screen should call ShowDialog to show it, then have the code to create the main form directly after. Then, when your splash screen closes itself, the next bit of code will create the main form.
So, why did you decide to use managed C++ ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
i use managed c++ because it is what is used in microsofft visual c++ EE 2005. i used it because it was the first free visual c++ compiler that was like what i wanted so i just use it. it works fine for me. if you know of any good programs like this that are better i would try it but i just do programming as a hobby right now and i cant afford to buy software.
Thank you for your help
- Kyle
|
|
|
|
|
Are you honestly saying that 2005 EE ONLY lets you use managed C++ ? Do you realise the difference between this and C++ ?
You're wrong, you can build C++ applications with EE 2005, you don't need to use managed extensions. I just checked the Microsoft site.
gr8coaster329 wrote:
but i just do programming as a hobby right now and i cant afford to buy software.
If you're learning, you should learn C++ first, then MC++. This way, you're essentially learning two languages at once. MC++ is C++ with additional constructs that let you use the .NET framework ( which means your app requires the .NET framework 2.0 to run ). You should write some console apps first, then some MFC apps before moving to MC++, and if you still want to, you should learn C# instead. I don't see any reason to use MC++ except to write bridging dlls between C++ SDKs and C#.
*edit* actually I don't think the free version offers MFC or ATL. Which means you're stuck with MC++ or Win32 SDK style code for windows apps, I guess.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I agree with all that Christian has said about the design being inappropriate but that's up to you.
The simple answer to the problem you have is that your timer event handler cmd_time_reached is not a member of the frm_splash_screen class so this->Close() will not close the splash screen (this doesn't point to it).
You don't show how the splash screen is created but you could keep a handle to it and do SplashScreen->Close()
The opinions expressed in this communication do not necessarily represent those of the author (especially if you find them impolite, discourteous or inflammatory).
|
|
|
|
|
i use shellexecute api function to run other application from my application. but now i need to close that running application from my application. how can i do that?
Thanks
Rastegar
|
|
|
|
|
send it a WM_CLOSE message ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
See ShellExecuteEx() and TerminateProcess() .
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
I am looking to develop a simple app in C that will search and extract text from a MS Word document and was hoping someone might be able to share their code or point me to a good source I can model. Thanks.
|
|
|
|
|
I am trying to write an app in VC++ (2002, 7.0) that reads information from a remote SOAP server. I've been trying to find something usable on here and on web searches but I can only find .NET or C# examples or irrelevant C++ examples. I'm looking for a piece of simple SOAP client source code in VC++ to send a request and receive a response. Can anyone point me to a good simple example I can work with?
|
|
|
|
|
You don't want to use the APIs that do this automatically ? I'm sur ethere's an SDK for this sort of thing.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Well, I went to this microsoft.com site for the SOAP Toolkit 3.0 which is the SOAP SDK but the first thing it says below the file information is "The Microsoft SOAP Toolkit is deprecated by the .NET Framework." and also later it says that the active toolkit support has expired so no new work will be contributed to it by Microsoft.
|
|
|
|