|
|
I have forgotten something stupid, mainly cause Id never do it.. two variables declared with same name but different scope
int something
{
int something
if refer to something here, which one used?
}
This will compile, won't it..?
Many, many thanks.
|
|
|
|
|
int something
{
int something
//This one will be used here
::something
//Refers to the other
}
|
|
|
|
|
Yes, but don't forget the :: op with no namespace spec looks for vars in the global namespace - vars can be hidden if declared at an intermediate scope:
int main(int argc, char* argv[])
{
int something(2);
{
int something(3);
cout << something << ::something << endl;
}
return 0;
}
This code won't compile until you uncomment the global decl for something .
The fn scope something is effectively hidden from code inside the local block.
|
|
|
|
|
I have created a dlg application. I have MyappDlg.cpp and .h module and Myapp.cpp and.h module. In the dlg part i just have the declarations and definitions of members and methods as button, editbox..., in the other part i have all the methods which the main aim is to do some calculations. So, as you could think i want to link the dlg part to the calculation part. So, in the dlg.h i just put the line:#include "MyApp.h"
So, i don't know if it's enough for doing the calculation in the dlg box. Is anybody could explain me the way of doing this job?
thanks in advance
gerald
|
|
|
|
|
If you have a dialog that needs to perform some specific calculations, it would make sense to include those functions in the dialog class. I don't know of any reason to keep them in the App class, but if so, then the line of code to #include the App class is generated for every cpp file by the class wizard automatically. To call its functions you would need to use AfxGetApp() for a pointer to the application object. hope that helps,
Jake
|
|
|
|
|
Can anyone give me some suggestions on how to replace window standard dialog view to an image.
thanks
nott
|
|
|
|
|
Override OnEraseBackground and draw your image.
Christian
#include "std_disclaimer.h"
The careful application of terror is also a form of communication.
Eagles may soar, but weasels don't get sucked into jet engines.
|
|
|
|
|
When I open a Dao recordset with more than one table ([MyTableOne] and [MyTableTwo], for example), the dataset is set read only and I can't update any records. I can't seem to find the answer to this one. All help appreciated!
Richard
|
|
|
|
|
I think the way the tables are joined and whether the db maintains referential integrity can have an impact on whether a join is updateable.
I know thats not a whole lotta help, but I do seem to recall from the dark and distant past that I was able to write to certain types of recordsets that were based on multiple tables.
Maybe MSDN article ID: Q175168 can give you some ideas.
|
|
|
|
|
Is true, When you open more than one table, the tables are read-Only This is for integrity.
You need to Write First one, and then the other one.
You Have FK for Integrity?
Because is Important, to poen in a order for the FK, because the database can refuse the insert....
Cheers!!!!
Carlos Antollini.
|
|
|
|
|
Hello !
I´ve read this article http://www.codeproject.com/dialog/skinstyle.asp
but how can i create anouther dialog box in my program with it ?
Like an About Box with its own skin and skin file , please tell me! !!
|
|
|
|
|
I have a doc/view program (sdi) and I want to be able to load and display bitmaps on the fly from .bmp files. I have an array of cells that the document keeps track of and I want the view to draw the correct bitmap who's filename will be stored in the cell object so that when OnDraw is called it looks up which bitmap it should be displaying and loads and displays it, opposed to having the bitmaps as resources. I have gathered that to load a specific bitmap you use the code...
HBITMAP hImage = (HBITMAP)LoadImage(NULL, "c:\\nick.bmp", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE|LR_DEFAULTSIZE);
but I cannot work out how to display it because everything I blit to the screen is blank. I've checked and the bitmap is loading ok, just not displaying.
How do you do this?
Cheers for any help
Nick
|
|
|
|
|
|
Thx a lot, looks like this'll work
Nick
|
|
|
|
|
An option I have used is using IPicture. It has a Render method that takes dc to draw the image onto. You can use gif, jpg, bmp, etc. Look in MSDN "How To Load and Display Graphics Files w/LOADPIC.EXE Q218972".
|
|
|
|
|
Hi
in my app I gave CFtpConnection class. how can i duplicate this variable? i mean, how can i make another excactly the same variable?
I've tried this:
CFtpConnection *pFtp;
....
pFtp = Session.GetFtpConnection(...);
...
...
CFtpConnection dFtp;
dFtp = *pFtp
...
and it didnt work...
so how can i do that?
thanks
|
|
|
|
|
Try this:
CFtpConnection *pFtp;
....
pFtp = Session.GetFtpConnection(...);
...
...
CFtpConnection *dFtp;
dFtp = pFtp
...
|
|
|
|
|
but that will create a new CFtpConnection pointer that points to the first CFtpConnection class, so if i change it, the first variable will change too, and that is something i dont want....
(i need the second CFtpConnection variable for a new thread that downloads a file from a FTP server that assosiated with the first CFtpConnection variable)
any other ideas?
thanks...
|
|
|
|
|
How about this:
CFtpConnection *pFtp;
....
pFtp = Session.GetFtpConnection(...);
...
...
CFtpConnection& hFtp = *pFtp;
|
|
|
|
|
Hi,
we are building up a collection of articles. A few of them are ready. I hope our collection of tips and tricks will grow up in the next time.
Take a look at it ...
http://www.klangwerker.de/developer/
CU Mario ///
----------------------
www.klangwerker.de
mario@klangwerker.de
----------------------
|
|
|
|
|
http://www.klangwerker.de/developer/
Ps! This is probably the most ugly website ever made
But the content is good beginner stuff.
Jimmy Hoffa
|
|
|
|
|
I am having the problem described at http://support.microsoft.com/support/kb/articles/Q240/8/69.ASP
(basically one of my operators thinks its ambiguous when it isnt, and I presume its because of this bug.) I cant work out if this document is giving me a way around it??
thanks,
Ben
|
|
|
|
|
If you post the code you're having a problem with we might be able to help
|
|
|
|
|
I don't know if this helps but this works:
template<class t=""> void f(T value);
void main() {
int nNum = 3;
const int *p = &nNum;
f(*p);
}
template <class t=""> void f(T value)
{
printf("%d", value);
}
Bret Faller
Odyssey Computing, Inc.
|
|
|
|