|
Thank you both. I was not casting properly.
My work product follows for anyone concerned.
//In C or C++ the following is true
//1. !0 is true and 0 is false
//2. !1 is false and 1 is true
//3. !Any number other than 0 is false and !0 is always true
enum logical { no, maybe, yes };
// no = 0 and !no is true
// maybe = 1 and !maybe is false
// yes = 2 and !yes is the same as !maybe
logical operator ! (logical x)
{
x = (logical)!(int)x;
return x;
}
logical operator &&(logical a, logical b)
{
logical x = no;
if(a &&(int) b)
{
x = yes;
}
return x;
}
void CTestinistuffDlg::OnCancel()
{
logical x(no);
logical a(maybe), b(yes);
//the Not operator
x = operator!(no); //returns maybe
x = operator!(maybe); //returns no
x = operator!(yes); //returns no
x = operator&&(no,no); //returns no
x = operator&&(no,maybe); //returns no
x = operator&&(no,yes); //returns no
x = operator&&(maybe,maybe); //returns yes
x = operator&&(maybe,no); //returns no
x = operator&&(maybe,yes); //returns yes
x = operator&&(yes,yes); //returns yes
x = operator&&(yes,no); //returns no
x = operator&&(yes,maybe); //returns yes
}
|
|
|
|
|
Hi,
I'm having some troubles with my MFC multi document application. When I create a new document, I would like it to fill the hole frame area. Is that possible, and how do I do it ?
With regards
jens Christiansen
|
|
|
|
|
Hi all,
I've created an ActiveX control using Visual C++ .NET.
When I add this control to a container created with Visual C++ .NET (or a Visual C++ 6.0) everything works and there is no apparently problem. But now, I'm trying to test this ActiveX with an application created with Visual Basic 6.0. The problem is that the ActiveX control does not appear in the list of registered components from the Visual Basic 6.0 (Menu -> Project -> Components, or Ctrl+T). So, I can't add my ActiveX to the Visual Basic 6.0 container.
When I try to make the same operation with a Visual Basic .NET container, I find the same situation, this is, the ActiveX control is not in the registered components list. But the ActiveX control is already registered.
I use the OleView application in order to ensure that the control is registered.
Due to my ActiveX control perfectly works with a Visual C++ .NET (and a Visual C++ 6.0) container, I suppose there is any bad chosen compiler option (by the time, everything is by default). Does anybody experimented the same situation testing his/her ActiveX in a Visual Basic container?
Thanks in advance.
|
|
|
|
|
I need to draw a chart (in 2D) and I'm programming in Visual C++ (.NET version 2003). I can´t use the controls in: http://www.codeproject.com/miscctrl/#Charting+Controls
because I'm not using MFC.
I've read that there is an ActiveX control called Microsoft chart Control but I don´t know how to use an ActiveX control in visual c++.
Please help me!!!
|
|
|
|
|
I've recently been tasked to write a number of C++ class that can be, with minimal effort, used with any of the Win32 C++ Compilers.
I have a question regarding raising events in the classes that I write. I'm curious to know how I would declare these events and assign handlers. My first guess would be function pointers, but I would like to know where there is a best practice way of doing this.
Also, if I use or develop an MFC specific class, do I have to register or assign event handlers through the Message Mapping macros?
Any tips or additional resources would be greatly appreciated.
Thanks in advance
|
|
|
|
|
may be this[^] can help ?!?
ooppss ... CP moved the article!
new location[^]
2 bugs found.
> recompile ...
65534 bugs found.
|
|
|
|
|
Great. This will help quite a lot. Thanks!
|
|
|
|
|
Most of us know a lot of games,Especially Like Red Alert 2 or any Command & Conquer Game,There are also
Games where the Player Have Guns and armor,There are some programs called "Trainers" That Can access the
memory of the game and modify the value of the Money,Armor,etc....
This "Trainer" knows the adress of the variable and knows its length (2-4-8-...)bytes so it can modify it.
Now,My question is -----> how do they do that ?
I'm Sure C++ Can do that.
In short,I want an Example of Two programs(Source Code C++) In the First there is a variable which I want to make the second program able to modify at runtime and check if the first program was running before trying to modify that variable.
|
|
|
|
|
|
Hello to all
I want to know if what is c++? I have an experience regarding programming but I am only using mini-compiler like debug command from MS-Dos Prompt. I am creating com,bat files.
Dark Angel
|
|
|
|
|
Debug Master wrote:
I want to know if what is c++?
Why not go straight to the source?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Is it possible to use MFC in an Add-In for Visual Studio .NET 2003 after one has chosen C++/ATL as the language to write the Add-In in? I have tried using MFC but I always get an error about have the Main function being defined twice.
Does anybody know of a solution?
I am the handsome one in the crowd.
|
|
|
|
|
As much as I love C++ it just isn't the right language to try to write add-ins with. Use C# or some other .NET language with managed C++ extensions if you have to.
During my first experiment with add-ins I learnt enough C# to be able to build a fairly reasonable build logger, with a lot less code than an equivalent C++ project, mainly because of all the interfaces that have to be implemented.
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts your aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
Here is my problem
The program should simply read the webpage that the user is looking at and grab the 'Title', the 'keywords' meta tags and the URL of the page being looked at.
Here is an example:
1a user visits http://www.insure.com/
2.The software grabs the title, keywords and URL.
3.The software makes a list of the keywords and phrases found.
4. an add to file
please some one help i requiredit immediately
-----------------------------
"I Think It will Work"
Formerly Known As "Alok The Programmer" at CP
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Hello,
You should try this[^] article. It should fit your needs.
Besides that, try googling first next time...
Multiply it by infinity and take it beyond eternity and you'll still have no idea about what I'm talking about.
|
|
|
|
|
thanks for reply,but that is not what i need,let me explain it to u.
Let you open any webbrowser and type a url for serach and from there i have to gather the title or url or meta tag thanks
-----------------------------
"I Think It will Work"
Formerly Known As "Alok The Programmer" at CP
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Hello,
I think that you want something like an add-in. I don't know how to help you on the add-in part, but I know that you can do almost anything you want from there...
Good luck!
Multiply it by infinity and take it beyond eternity and you'll still have no idea about what I'm talking about.
|
|
|
|
|
What you are after is IE Automation. I have dozens of little VBS files on my computer that do various things with Web sites. Some I have even added as a scheduled task if I want to do them regularly. For example, here is one that gets the current security threat level. It's not finished (I was just testing az theory), nor is it as "pretty" as the XML version that is floating around.
Dim objIE
Set objIE = WScript.CreateObject("InternetExplorer.Application")
objIE.Navigate "http://www.whitehouse.gov/homeland/"
objIE.Visible = true
While objIE.Busy = true
Wend
Dim objTables
Set objTables = objIE.Document.all.tags("TABLE")
Dim objTable
Set objTable = objTables(12) ' get the 13th <TABLE> tag
Dim objRow
Set objRow = objTable.rows(0) ' get the 1st <TR> tag
Dim objCol
Set objCol = objRow.cells(0) ' get the 1st <TD> tag
Dim objImg
Set objImg = objCol.all(0) ' get the 1st <IMG> tag
MsgBox objImg.src Here's one I made for a friend a few years back to help him enter a sweepstakes contest:
Dim IE
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.Navigate "http://www.nralive.com/sweeps/enter.cfm", NULL, NULL, NULL, NULL
' wait until the page is fully loaded
While IE.Busy = true
Wend
' assuming there are 4 radio buttons named "enteringBy", operate on the 4th (index 3) one
IE.Document.all("enteringBy", 3).checked = true
IE.Document.all.fname.Value = "J"
IE.Document.all.lname.Value = "S"
IE.Document.all.email.Value = "j"
IE.Document.all.address.Value = "2"
IE.Document.all.city.Value = "S"
IE.Document.all.state.Value = "O"
IE.Document.all.zip.Value = "7"
IE.Document.all.phone.Value = "4"
' click the "next" button
IE.Document.all.tags("INPUT").item(12).click()
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hi,
I'd like to know what is GNU C++ and which compilers doing this?
I really don't know what is this?
Regards,
-
When in doubt, push a pawn!
-
|
|
|
|
|
|
Hi all
I derived a class from CSocket.
I created an object of that class m_Socket.
I get error number 10022 when I call m_Socket.Create(8998,SOCK_DGRAM,NULL).
It works well on win2000, but fails on winNT dont know why ?
Any help would be greatly appreciated!
Regards
The Best Relligion is Science.
Once you understand it, you will know God.
|
|
|
|
|
|
Hi
I got it..it was because the specified socket was already in use in the othe machine.
Regards
The Best Relligion is Science.
Once you understand it, you will know God.
|
|
|
|
|
Hello,
I am trying to send a structure using PostMessage.
My structure is of the form:
typedef DATA
{
int EventID;
CString ModuleName;
CString ThreatName;
} info;
info info_data;
PostMessage(WM_MYMSG, (info_data&)wParam,NULL);
In the recieving thread I tried this way:
info_data = (info_data&)wParam; // I am getting runtime error here.
Can anyone please help me to pass a user defined structure using PotMessage?
Thanks
Madhavi
|
|
|
|
|
Use wParam to send your structure pointer, i.e.
PostMessage(WM_MYMSG, (WPARAM)&info_data, NULL);
Note that you can only send pointer to your structure, so make sure that it is accessible in message handler.
ARSALAN MALIK
|
|
|
|