|
thanks, all ur answers are really helpful!
|
|
|
|
|
I was reading about VC++ Express Edition on MS site earlier this week - as far as I remember, it DOES NOT support MFC, only SDK-level programming and Managed C++.
I could be wrong of course, since everyone else is telling you about doing MFC in VC++ EE 2005.
|
|
|
|
|
|
Hi all,
I have an application with several tabs, selection made in one tab is suppose to update the values on a few other tabs (from database). I tried creating a function and call it when the selection is change. This function activates the refresh buttons on the various tabs. But this method is unable to work.
XXXOnDbClick()
{
// processing done here
.............
// processing end
Ctab1 *tab1;
Ctab2 *tab2;
tab1->Refresh();
tab2->Refresh();
}
void XXX:Refresh();
{ // as the button is private, this is the only way I can activate it
OnButtonRefresh();
}
I want to be able to view the updated values when selecting the tab instead of having to press the refresh button everytime.
Thanks in advance.
|
|
|
|
|
Handle TCN_SELCHANGE instead of WM_LBUTTONDBLCLK
|
|
|
|
|
salam guys
is there any significant difference between vc and vc.net, i dont find any big differenc in programing enviroment perhaps it might b different in build!!
thax in advance,may god help u solve ur problem as well!!
|
|
|
|
|
well, in vc it is possible to use managed code (code managed by the .net framework). There are a lot of useful features in the .net framework. However, if you use the .net framework, it has to be installed on the pc where you run it.
Geert
Want to spread the newest version of your software automatically for free? Use Updater!
Visit my website: www.gvhsoftware.org
|
|
|
|
|
well i want 2 learn any of the .net languages so do u think its sufficient 2 use vc.net n i shud not go 2 c#?
hop u'l respond again
|
|
|
|
|
well, that depends. If you are a windows only developer, I would definitely go for C#. Microsoft is pushing everyone from C++ to C#, and why don't learn the new language?
I am still stuck on C++. The reasons for this are:
1) If you use .net, you HAVE to use the .net framework. This is only supported by newer window versions.
2) C++ rocks, but if you have to learn a new language, C# is almost the same as C++ (almost same syntax).
Geert
Want to spread the newest version of your software automatically for free? Use Updater!
Visit my website: www.gvhsoftware.org
|
|
|
|
|
I creat a file DLL by MFC use VisualBasic. But Input and Ouput
don't compatible:
// C++
extern "C" void PASCAL EXPORT CCreatFile(char lptFileName[20],char lptPath[200])
{
FILE *ptrFile;
char lptstr[250];
strcpy(lptstr,lptPath);
strcat(lptstr,lptFileName);
strcat(lptstr,".ads");
if(lptstr ==NULL)
{
MessageBox(NULL," File NULL!!!","Adsoft !",MB_ICONWARNING|MB_OK);
return;
}
ptrFile=fopen(lptstr,"wb");
if(ptrFile ==NULL)
{
MessageBox(NULL,"Can't creat File !","Adsoft warning !",MB_ICONWARNING|MB_OK);
return;
}
fclose(ptrFile);
}
// VB
Private Declare Sub CCreatFile Lib "AdsoftDLL.dll" (TenB1 As String, Tenb2 As String)
Private Sub Form_Load()
Dim fileName As String
Dim PathName As String
fileName = "KimDo"
PathName = "C:\\"
Call CCreatFile(fileName, PathName)
End Sub
result erroneous
|
|
|
|
|
If I remember correctly, the parameters of the VB function (so the prototype) must use strings by val:
Private Declare Sub CCreatFile Lib "AdsoftDLL.dll" (ByVal TenB1 As String, ByVal Tenb2 As String)<br />
Also, I'm not sure if that will work:
Thangnc wrote:
extern "C" void PASCAL EXPORT CCreatFile(char lptFileName[20],char lptPath[200])
I think you will need to change it to that:
extern "C" void PASCAL EXPORT CCreatFile(char* lptFileName,char* lptPath)
But for that point, I'm not sure at all.
Hope this helps. If not, try to give more details about the errors (crash, error messages, ...)
|
|
|
|
|
Hi, can anyone plz help me ...
im creating an application with easy PNG skinny feature, im using CxImage lib. to load and draw Transparent Images , but i have a big problem , now i want to tell u step by step im creatin my apllication and problem.
1. I am creating a Dialog based Application . and then add this code in
OnInitDialog func, :
{
/* This will Load PNG Image into the CxImage Lib Object */
image.Load( "C:\xxx.png",CXIMAGE_FORMAT_PNG);
}
2. Then i remove all code from WM_PAINT func. and add my code in there
like this :
CSkinDlg::OnPaint()
{
CPaintDC dc(this);
CRect rc;
GetClientRect(&rc);
image.Draw(&dc, rc, 0 , true); /* image is the Object of CxImage Lib.
and draw will draw the PNG image on the Application. */
CDialog::OnPaint()
}
3. and then i use WM_ERASEBKGND func. to Draw the Backgound
Transparent like:
CSkinDlg::OnEraseBkgnd(CDC *pDC)
{
return TRUE;
}
4. with this all things every thing is workin fine , but the problem is when
i move the dialog , it draws Trails of the Drawed Image, or if i want to
draw an another image on the current image then it also draws the Trails
the main background image.
I also used the way of TRANSPARENT dialog. by using the
ModifyStyleEx( 0 , WS_EX_TRANSPARENT); , But the problem is that
when i Refresh my desktop , the dialogs goes invisible, and then an i
have to click on the dialog again to show.
Please tell me how to redraw intire dialog with an timer based func. and
how to draw an another image on bkground image without leaving trails.
i also used RedrawWindow() and Invalidate() to redraw but its not workin.
NOTE: please dont use any of floags like WS_EX_TRANSPARENT or
WS_EX_LAYERRED. this is not workin fine.
Now itz up to my friends .
Plz help me my friends its my dream project .
thnx.
|
|
|
|
|
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++
|
|
|
|
|