|
Hi, I want to fire all the Html element events taking place in "Internet Explorer" in my VC++ application Use the following code fragment to obtain an event handler
//get IHTMLSelectElement
IHTMLSelectElement* pselectelement=NULL;
spSelectElement->QueryInterface( IID_IHTMLSelectElement,(void **) pselectelement);
//Retrieves a pointer to the event handler function associated with the
//onchange event on the SELECT element, but i can't get it
VARIANT * p=NULL;
pselectelement->get_onchange(p);
HTMLSelectElementEvents* pselectelementevent=NULL;
pselectelement->QueryInterface( DIID_HTMLSelectElementEvents,(void **) &pselectelementevent);
//get_onevent function can be found in msdn but can't seek in headfile MSHTML.H
((IHTMLElement*)pselectelement)->get_onEvent( &_variant_t(pDisp) );
if (pselectelementevent)
// fire event
HRESULT hr=_com_dispatch_method(pselectelementevent,
0x3e9, DISPATCH_METHOD, VT_EMPTY, NULL, NULL);
help me ! sos
TKS
VICTOR.ZOU
-- modified at 3:15 Tuesday 21st February, 2006
|
|
|
|
|
So what is your question ?
~RaGE();
|
|
|
|
|
my question is the code fragment don't work, I can't get event handle ,and can't fire the event
|
|
|
|
|
class EXPORT_MY My : public CScrollView
There are a lot of warnings
C4273 inconsistent dll linkage. dllexport assumed.
and errors
C2491 definition of dllimport static data member not allowed
How to export correctly?Thanks.
|
|
|
|
|
can any one please show me a working example of how to convert doubles into
string and combine them,
like
double a=0.1;
double b=0.1;
String c;
I want to display something like "0.1 + 0.1 equal to 0.2"
Thanks
|
|
|
|
|
CString cstrResult;
cstrResult.Format("%f + %f equal to %f", a, b, a + b);
cout << cstrResult;
Can these code solve your problem?
|
|
|
|
|
I guess haian2442's answer will most certainly please your teacher.
|
|
|
|
|
It definately will
haian2442 you are the man.
|
|
|
|
|
blang0477 wrote: It definately will
Just be sure to give credit where credit is due.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
|
|
|
|
|
I am simulating 5 independent units transmitting from a single port out. Each of them has to have a maximum time window of 2250ms and also able to stop transmitting once they have transmitted all their messages.
How do I make them transmit for a maximum of 2250ms?
|
|
|
|
|
You can use a timer.
~RaGE();
|
|
|
|
|
I've never used the datasets and tableadapters in visual studio before and I'm having some trouble trying to figure them out. Right now it's going like this. I have a strongly-typed dataset on my form, I also have a bindingsource that's bound to the dataset and my database table, this created a tableadpater for me. Now because some columns in the database are just id's that the user doesn't need to know about I don't have controls for them on my form. My question is how to I update this information in the dataset so that it's populated back to the database? I'm trying something like this, but I know it's not right.
Guid guid = Guid.NewGuid ();
myDataSet.myDataTable table = myTableAdapter.GetData ();
table.idColumn = guid.ToString ("N");
myBindingSource.EndEdit ();
myTableAdapter.Update (this.myDataSet.eps); I think the basic question is how to I update/insert/delete on a strongly-typed datatable from within code?
I know this isn't the C# forum, but I'm not getting any answers there. If you want to give me some solutions or help in C++ I'm fine with converting it over. Thanks for any and all help.
- Aaron
|
|
|
|
|
Hello all,
I have written a program which contains a GUI windows and also a console windows. When the program start, I allocate a console window from Windows. When the user close the console window during the programming is running, my main GUI get closed at the same time too. What I think is that may be the console window process is a child process of the main GUI window, when the child prcoess get closed, its parent process will also be destoryed. However, the destcutor of my main GUI porcess didn't get called when the console get closed which cause a lot of memory leaks. Do anyone know why my main GUI window destructor did get called when one of it child process get closed?
|
|
|
|
|
nachilau wrote: I have written a program which contains a GUI windows and also a console windows. When the program start, I allocate a console window from Windows.
How are you doing that exactely ?
nachilau wrote: when the child prcoess get closed, its parent process will also be destoryed
Certainly not.
~RaGE();
|
|
|
|
|
The way that I do it is
AllocConsole();
m_hout = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleMode(m_hout, ENABLE_PROCESSED_OUTPUT | ENABLE_WRAP_AT_EOL_OUTPUT);
If you say that it is not true that when the child process get deleted, the parent process also get deleted, then I don't understand why my GUI get closed when the user close the console window.
|
|
|
|
|
Hi,
Does someone knows , or knows a demo, package how to extract data from a txt file and plot directly by using Visual C++ 6?
Thanks a lot,
TPP
|
|
|
|
|
|
I am developing VC++ Application using Managed Extensions in visual Studio .NET 2003. I have selected the .NET Console Application Template for this and included the necessary namespaces and dll files. Th problem I am being facing is: OnPaint Event Handler is not working (!unresolved link externals). How do I resolve this? I am pasting the code below.
#include "stdafx.h"
#using <mscorlib.dll>
using namespace System;
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#using <system.dll>
#using <system.drawing.dll>
#using <system.windows.forms.dll>
using namespace System::Windows::Forms;
using namespace System::Drawing;
using namespace System::Drawing::Imaging;
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// Managed class subjected to Garbage Collector indicated by __gc keyword
__gc class MyForm:public Form
{
public:
//Constructor
MyForm();
protected:
//When the form is to be re-painted the OnPaint() event handler will be invoked
void OnPaint(PaintEventArgs *e);
private:
//To display graphic file on the we must use Bitmap Class object like:
Bitmap *m_Bitmap;
// Event handlers for the Menu Commands
void OnMnuOpen(Object* sender, EventArgs *e);
void OnMnuSave(Object* sender, EventArgs *e);
void OnMnuExit(Object* sender, EventArgs *e);
};
//Constructor
MyForm::MyForm()
{
//Creating Menu for the form (Object of MainMenu type)
MainMenu *mnu = new MainMenu();
//Creating Menu Items (Object of MenuItem type)
MenuItem *item = mnu->MenuItems->Add("File");
/*
Creating the options that appear under the File menu and add them to
File MenuItem
*/
item->MenuItems->Add("Open",new EventHandler(this,&MyForm::OnMnuOpen));
item->MenuItems->Add("SaveAs",new EventHandler(this,&MyForm::OnMnuSave));
item->MenuItems->Add("Exit",new EventHandler(this,&MyForm::OnMnuExit));
/*
The entire menu has been created but it will will be visible only when its
reference is passed to the menu property of the form, which is done by the
line of code below i.e. this->Menu = mnu;
*/
this->Menu = mnu;
}
void MyForm::OnMnuOpen(Object* sender, EventArgs *e)
{
//using Windows Open Dialog Box
OpenFileDialog *Odlg = new OpenFileDialog();
Odlg->Filter = Odlg->Filter->Concat((String *)"Image Files(JPEG, GIF, BMP, etc.)|*.jpg; *.gif; *.bmp; *.tif; *.tiff; *.png");
Odlg->Filter = Odlg->Filter->Concat(Odlg->Filter,"|JPEG Files (*.jpg; *.jpeg)| *.jpg; *.jpeg");
Odlg->Filter = Odlg->Filter->Concat(Odlg->Filter,"|GIF Files (*.gif)|*.gif");
Odlg->Filter = Odlg->Filter->Concat(Odlg->Filter,"|BMP Files (*.bmp)|*.bmp");
Odlg->Filter = Odlg->Filter->Concat(Odlg->Filter,"|TIFF Files (*.tif; *.tiff)| *.tif; *.tiff");
Odlg->Filter = Odlg->Filter->Concat(Odlg->Filter,"|PNG Files (*.png)|*.png");
Odlg->Filter = Odlg->Filter->Concat(Odlg->Filter,"|All Files (*.*)|*.*");
Odlg->FilterIndex = 3;
// Handling the click OK of the Dialog
if((Odlg->ShowDialog()) == DialogResult::OK)
{
String *fileName = Odlg->FileName;
if(fileName->Length != 0)
{
try
{
m_Bitmap = new Bitmap(fileName);
AutoScroll = true;
AutoScrollMinSize = m_Bitmap->Size;
Invalidate();
}
catch(Exception *e)
{
MessageBox::Show("Invalid image format", "ERROR");
}
}
}
}
void MyForm::OnMnuSave(Object* sender, EventArgs *e)
{
SaveFileDialog *Sdlg = new SaveFileDialog();
Sdlg->Filter = "JPEG Files(*.jpg; *.jpeg)|*.jpg; *.jpeg |GIFF Files(*.gif)|*.gif|BMP Files(*.bmp)|*.bmp|TIFF Files(*.tif; *.tiff)|*.tif; *.tiff";
if(Sdlg->ShowDialog() == DialogResult::OK)
{
String *SaveStr;
/*
FilterIndex refers to the index of the file types in the filter string
that is currently selected by the user
*/
//Getting the Index of the selected file type in the filter
int index = Sdlg->FilterIndex;
//Getting the File name typed by the user
SaveStr = Sdlg->FileName;
switch(index)
{
case 1:
m_Bitmap->Save(SaveStr,ImageFormat::Jpeg);
break;
case 2:
m_Bitmap->Save(SaveStr,ImageFormat::Gif);
break;
case 3:
m_Bitmap->Save(SaveStr,ImageFormat::Bmp);
break;
case 4:
m_Bitmap->Save(SaveStr,ImageFormat::Tiff);
break;
}
}
}
void MyForm::OnMnuExit(Object* sender,EventArgs *e)
{
this->Close();
}
int _tmain()
{
Application::Run(new MyForm());
return 0;
}
Syed Fasih
|
|
|
|
|
(wrong forum, go have a look at the CLI/C++ one )
but I was wondering, why did you select a console application for what it looks a Form based application ?
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Well In Visual Studio .Net 2003 I am not able to find template named MANAGED APPLICATION. This code must be used for Managed .... My friend told me put it in Console... Please guide me as I am new to Managed code
Thank you in advance;)
|
|
|
|
|
I am student, i need to develop a application that requires to access a function that is already available in outlook 2003 (specifically the dial function in the the action menu of outlook 2003). If someone can tell me how to access the function, it would be really helpful
Thanking you in advance
Robin Bhatnagar
|
|
|
|
|
Does Outlook COM expose it as an interface?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
|
|
|
|
|
hi David,
Outlook exposes its functionality through many interfaces. the application ID of outlook is outlook.application.u can search it in registry.then u can find out the dll for that. and after that everything is in ur hand.
bye,
.
chetan prakash agrawal
|
|
|
|
|
I knew this. I was prodding zeeshan to do some research on his own. I'm a big fan of the old "Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." adage.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
|
|
|
|
|
I am currently doing an application and i am required to save data from edit boxes to a file and load them when need. I am familiar with the C++ , FILE *fp method of file i/o. But is there a proper and simple MFC method for doing file i/o ? (Sample code greatly appreciated =) )
Thanks
|
|
|
|