|
I'm sure there's a better way, but i used a bit of javascript to compose the resource URLs:
strBasePath = document.location.toString();
strBasePath = strBasePath.substring(0, strBasePath.length-3);
document.body.background = strBasePath + "background.jpg";
---
Shog9
Actually I use to find learning in bars when drinking really useful.
It sort of makes a language liquid. - Colin Davies, Thinking in English?
|
|
|
|
|
It doesn´t work!
I´m still unable to display these images on my dialog, nor using the original file name "title.gif" or the resource index "106" . . .
I´m confuse.
Thanks.
"nobody knows it, but you´ve got a secret smile, and you use it only for me"
|
|
|
|
|
How are you naming your resources? Make sure you include the name in quotes, or VS will give it a number instead. (yes, you can use a resource index, but i don't remember how off the top of my head. Use a name 'till you've got the kinks worked out.)
---
Shog9
Actually I use to find learning in bars when drinking really useful.
It sort of makes a language liquid. - Colin Davies, Thinking in English?
|
|
|
|
|
Yes, it works!
Thanks.
"nobody knows it, but you´ve got a secret smile, and you use it only for me"
|
|
|
|
|
I get an error saying arguments are of wrong type.
yet I've declared the buffer I'm reading from (with Write) as a variant - documentation mentions that. I am just trying to set the value of a field in an access db.
Thank you,
ns
|
|
|
|
|
Greetings...
I have a custom control similar to a grid and I am using only Win32 techniques. It has two scrollbars - horizontal and vertical on top and bottom.
When I have more rows to show then the client area I show make my vertical scrollbar visible using ShowWindow function with SW_SHOW flag. I am using the following method to set the size of scroll box of the vertical scroll bar.
#define CUST_DEFHIEGHT 25 // the defaul height of each row in the window.
#define CUST_DEFWIDTH 50 // the default width of wach column in the window.
int nRowNotVis; // how many rows are not visible.
SCROLLINFO scf;
// Get the total client rect of the window.
GetClientRect ( hwnd, &rectWin ); // where hwnd is my custom control.
// Then I calculate how many rows are not being shown.
nRowNotVis = (INT)((row * CUST_DEFHIEGHT) - (rectWin.bottom-(2*CUST_DEFHIEGHT)))/CUST_DEFHIEGHT;
// where row is the total number of rows my Grid has.
// I have left 1 row space in the top and bottom each coz I need them for other purpose.
// Then I use the following code to set the info abdout the scrollbar.
scf.cbSize = sizeof ( SCROLLINFO );
scf.fMask = SIF_RANGE | SIF_POS | SIF_PAGE;
scf.nPage = row-nRowNotVis;
scf.nMin = 0;
scf.nMax = nRowNowVis+1;
scf.nPos = 0;
SendMessage ( hwndVScroll, SBM_SETSCROLLINFO, (WPARAM)FALSE, (LPARAM)&scf );
// Doing this does not change the size of the scroll box in the scroll bar and
// the size remains the same as the scrollbar.
What is going wrong ?
The same thing happens when I use set the value of the Horizontal scrollbar
// now for the horizontal scroll bar.
scf.cbSize = sizeof ( SCROLLINFO );
scf.fMask = SIF_PAGE | SIF_RANGE | SIF_POS;
scf.nPage = col-nCol;
scf.nMin = 0;
scf.nMax = nCol+1;
scf.nPos = 0;
Where nCol is the number of columns not shown in the Window and col is the number of column in the window ?
Please help me ?
I am able to scroll the contents in the window properly but my scrollbox size is not getting effected so I am not able to position it properly also.
Thanks in advance.
Ritesh Nadhani
|
|
|
|
|
After changing internal scrollbar parameters (nMin, nMax, nPage) you should use MoveWindow, SetWindowPos etc. to set correct position and size of scrollbars
nobody is perfect
|
|
|
|
|
1.You don't need to use SendMessage because this's your program and your thread. Only use SetScrollRange, SetScrollPos...
2.I guess that you forgot to call RedrawWindow and UpdateWindow
Hung Son
A Vietnamese student
i-g.hypermart.net
dlhson2001@yahoo.com
|
|
|
|
|
How can we convert a number represented by DWORD to string or std::string.
Example:
DWORD number=731;
I want to convert "731" to standard string and std::string. Plz tell me how ???
|
|
|
|
|
for conversation any number into string I used to sprintf
|
|
|
|
|
Maybe its not so good, but i use:
char cBuf[5];
string s(itoa(dwNumber, cBuf, 10));
nobody is perfect
|
|
|
|
|
Hi people,
Does anyone have any suggestions on how to implement the following:
I've made a three page wizard and after the user clicks finish on the third page, I want to pop up a small dialog with nothing but a cancel button and a "Please wait while the data is being saved." message.
My initial plan was to let that dialog do the saving, although that means I'll need to make some detours to access the data that needs to be saved. The problem with that is that I can't seem to find the right windows message handler to start the saving procedure in. Basically, I can't find a WM that fires right after the dialog is shown on screen.
Another approach would be to let the wizard itself handle the saving, but in that case I'd have to make my 'please wait' dialog non-modal. And naturally, I don't want the user tampering with the wizard while it's saving. On top of that, it becomes more complicated to implement the cancel button. I can't see that happening without setting up separate threads. That somehow seems too complicated.
Anyone feel like pointing out the simple path that I'm sure is there somewhere? Thanks a lot...
ren
|
|
|
|
|
renegade the immortal wrote:
Basically, I can't find a WM that fires right after the dialog is shown on screen.
In your WM_INITDIALOG handler, call ShowWindow() to make the dialog visible.
--Mike--
Just released - RightClick-Encrypt v1.3 - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
separate threads. That somehow seems too complicated.
No, you should use threads for your problem. Because you just need a worker thread, so you can use AfxBeginThread .
Ex:
Declare: static UINT SaveThread(LPVOID lParam)
Implement:
UINT SaveThread(LPVOID lParam)
Calling:
AfxBeginThread(SaveThread,yourParam);
Hung Son
A Vietnamese student
i-g.hypermart.net
dlhson2001@yahoo.com
|
|
|
|
|
i worked in a company before. many apps shared to use a public database, the db (not SQL one) consisted lots of arrays, which hold pointers to some type of objects.
unfortunately, some apps saved bad pointers (pointed to nothing but not null) to the db.
once other apps accessed to those bad pointers, the apps crashed.
do u know how to access to bad pointers with no crash (i.e. find they are bad then skip them)?
thx
includeh10
|
|
|
|
|
Can you provide more detail on the file structure and details of what the crashes are.
In the good old days of DOS, I used to have to manually fix bad pointers in files with a hex editor.
Michael
Time flies like an arrow. Fruit flies like a banana
|
|
|
|
|
similar to this, i think:
//the database is called "Object Store"
//did by some one else
MyClass p=new MyClass;
delete p;
ary.Add(p); //ary is an Array
db.Save(); //Save to database
//i do
db.Open(file_name);
int i,iNum=ary.GetSize();
for(i=0;i < iNum;i++)
{
int iSomeValue=ary.GetAt(i)->iSomeValue;
}
note: one of ary.GetAt(i) above gets bad pointer.
thx
includeh10
|
|
|
|
|
Maybe you should derive all your classes from CObject and use IsKindOf?
nobody is perfect
|
|
|
|
|
That's your mistake. You should check your code before running
Hung Son
A Vietnamese student
i-g.hypermart.net
dlhson2001@yahoo.com
|
|
|
|
|
You can check some bap pointers with a function like IsBadReadPtr and similar functions but it will not detect all bad pointers (and maybe none with our sample).
You can also uses exception handling to catch access violation and do so other validation to ensure that the pointer do point to valid data.
So any solution are a patch but when we want to handle corrupted files, we often have no choice than to fully validate the data and skip any data that does not appears to be good!
Or if you can fix the data itself, simply correct existing files and create new files without corrupted data (you may in that case want to add some means to detect that you have a new file and skip validation in that case).
Philippe Mori
|
|
|
|
|
You can try to use AfxIsValidAddress , look up in MSDN on its parameters and explaination
Philip Patrick
Web-site: www.stpworks.com
"Two beer or not two beer?" Shakesbeer
|
|
|
|
|
I mean through an example..
|
|
|
|
|
Can it help you?
system(<br />
<br />
"rundll32 shell32.dll,SHExitWindows VALUE");<br />
<br />
Here are the different VALUES you can put in:<br />
<br />
0 Logoff User<br />
<br />
1 Shutdown Windows<br />
<br />
2 Restart Windows<br />
<br />
4 Force Applications to be killed<br />
<br />
8 Poweroff (if supported by your PC)<br />
<br />
-1 restart the GUI without a shutdown
Hung Son
A Vietnamese student
i-g.hypermart.net
dlhson2001@yahoo.com
|
|
|
|
|
I want the first column of my list view to be right aligned but it wont let me align it. I can align any of the other colums to the center or right but the first column is always left align. Is there a way to get the first column right aligned?
|
|
|
|
|
From MSDN
If a column is added to a list-view control with index 0 (the leftmost column) and with LVCFMT_RIGHT or LVCFMT_CENTER specified, the text is not right-aligned or centered. The text in the index 0 column is left-aligned. Therefore if you keep inserting columns with index 0, the text in all columns are left-aligned. If you want the first column to be right-aligned or centered you can make a dummy column, then insert one or more columns with index 1 or higher and specify the alignment you require. Finally delete the dummy column.
Michael
Time flies like an arrow. Fruit flies like a banana
|
|
|
|