|
|
|
Programm3r wrote: BOOL rc = DeleteFile((LPCTSTR)attFName);
The (LPCTSTR) cast is not needed and should be removed; there is little point (and some danger for maintenance programmers) in casting something to the type it already is, especially when unsafe C-style casts are used.
Steve
|
|
|
|
|
Stephen Hewitt wrote: and some danger for maintenance programmers
Thanx Stephen, I'll keep it in mind next time
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
Try to avoid C-style string manipulation functions; use a string class instead. Here's code to do the same using std::string s:
string name = "C:\\dir\\";
name += fileName;
BOOL rc = DeleteFile(name.c_str());
Or using MFC's CString class:
CString name = "C:\\dir\\";
name += fileName;
BOOL rc = DeleteFile(name);
Steve
|
|
|
|
|
Hi,
Any information on adding .GIF files to the dialog .. please let me know..
Harsha
|
|
|
|
|
Hi Harsh !
I've developed a class to render any gif file to any control. Controls can be dialogs, buttons, listboxes, list controls etc. Any control means Any Controls.
If u want that class, come online at:- jubinc@skype
Come online at:-
jubinc@skype
|
|
|
|
|
I wish i can come online.. but right now i am in office and i cannot use any applications like skype and messengers.. can you please send the class to my mail ..
mail id harsh_2961@yahoo.co.in
Harsha
|
|
|
|
|
Local E-mail system has not been working since past 4-5 days and won't work till next week. And mail sites are restricted here. Only skype is allowed. If u could come at Skype, then u can have it.
Come online at:-
jubinc@skype
|
|
|
|
|
ok.. i will let you know when i come online... thanks a lot...
Harsha
|
|
|
|
|
A simple alternative is using GDI+...
To load and draw a gif takes 3 lines of code (not including GDI+ initialization at the app level)
Gdiplus::Bitmap SrcBitmap(L"C:\\test.gif", FALSE);
Gdiplus::Graphics DstGraphics(hwndDialog);
DstGraphics.DrawImage(&SrcBitmap, 50, 50, SrcBitmap.GetWidth(), SrcBitmap.GetHeight());
Mark
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
Dear friends,
I have done one functionality using MDI and CFormView.
There i am using Menus to access different functions. Now i have to change it. My client wants me to chnage menus to Tabs. I have to use old code for the functionality as i have very less time in hand. Can u please suggest me what should i go for Property pages or Tab controls???
its really very urgent..
Megha
|
|
|
|
|
|
how to receive the signal from usb. i am having a biometric usb where i have to receive the signal if the user gives thumb impression. how to do this
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
deeps_cute wrote: i am having a biometric us
You should have a driver supplied with your USB stick. What you will need to do in your application, is open the driver using CreateFile and then you can exchange commands with the driver using DeviceIOControl (or you can also use ReadFile and WriteFile, but that depends of how the driver is implemented). Normally, everything should be described in the documentation of your device.
|
|
|
|
|
|
firstly, here is the Link to your message[^]
secondly, fix it very soon or you gonna be declared abusive...
|
|
|
|
|
actually i wanted to send a message n i was just writing it
but due to some reasons i discarded it
now i don knw how this msg appeared on board
i'll check it out
|
|
|
|
|
How can we find a text in RichEditCtrl . i am using CRichEditCtrl and FindText()
is returning only 1st Occurance of that Text .
|
|
|
|
|
Use CHARRANGE , which is member if FINDTEXTEX .
In following example control will be looked for whole range
FINDTEXTEX ft;
ft.chrg.cpMin = 0;
ft.chrg.cpMax = -1;
ft.lpstrText = (LPSTR) lpszmyString;
long n = pmyRichEditCtrl->FindText(FR_MATCHCASE|FR_WHOLEWORD, &ft);
Now if you want to find string betn range 4th char to 7th char yoiu need to mention it like,
FINDTEXTEX ft;
ft.chrg.cpMin = 3;
ft.chrg.cpMax = 7;
ft.lpstrText = (LPSTR) lpszmyString;
long n = pmyRichEditCtrl->FindText(FR_MATCHCASE|FR_WHOLEWORD, &ft);
|
|
|
|
|
Hello All,
I am trying to read a text file & add the words and offset in to map table.
Can anyone please tell me how to calculate the offset of the words in the file ??
<code>
#include<iostream>
#include<map>
#include<string>
#include<fstream>
using namespace std;
typedef map<string,int> FileMap;
#define SIZE 255
char sBuffer[SIZE];
int main()
{
string word;
int offset;
FileMap FMap;
ifstream fin;
fin.open("D:\\Demo.txt",ios::in);
while(!fin.eof())
{
fin >> sBuffer;
// FMap[sBuffer]=offset;
}
fin.close();
cout << "\n Enter Word:";
cin >> word;
offset=FMap[word];
cout << "\n Word Offset is :" << offset;
return 0;
}
</code>
Thanking you,
Suresh HC.
|
|
|
|
|
What do you mean by offset exactly ? The index (in the file) of the first character of the word ? If yes, in your loop you can simply increment the offset counter by the size of the last word read:
while(!fin.eof())<br />
{<br />
fin >> sBuffer; <br />
offset += strlen(sBuffer) + 1;
FMap[sBuffer]=offset;<br />
}<br />
There is also a flaw in your design: if the user enters a word that was not stored in the map, then you'll get a crash. It is better to check if the key exist in the map (using the find function).
|
|
|
|
|
Thanks Cedric Moonen i will check it.
|
|
|
|
|
Hi All,
Is there any data types to specify unsigned __int64??
VikramS
|
|
|
|
|
vikrams wrote: data types to specify unsigned __int64
ULONGLONG , ULONG64
Do your Duty and Don't expect the Result Rate this Post, if I helped You
|
|
|
|