|
Hi,
code for inseting file names to list box & i have open only txt files only.
void CSearchDlg :: disp ()
{
int i = 0;
while (strlen (shWord[i].file_name) > 1)
{
m_SOUT.AddString(shWord[i].file_name);
int k = 0;
TCHAR buff[100];
strcpy(buff,"\0");
while (shWord[i].w_offset[k] != -1)
{
TCHAR buffer[50];
int f=shWord[i].w_offset[k];
_itoa(f,buffer,10);
strcat(buff,buffer);
strcat(buff,",");
k++;
}
buff[strlen(buff)-1]='\0';
m_SOUT.AddString(buff);
i++;
}
}
|
|
|
|
|
while (shWord[i].w_offset[k] != -1)
{
TCHAR buffer[50];
int f=shWord[i].w_offset[k];
_itoa(f,buffer,10);
strcat(buff,buffer);
strcat(buff,",");
k++;
} try this:
while (shWord[i].w_offset[k] != -1)
{
sprintf(buff,"%s%d,",buff,shWord[i].w_offset[k]);
k++;
} vinaycool wrote: m_SOUT.AddString(shWord[i].file_name);
what is datatype of file_name?
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
Hi Laxman,
I got the solution, the problem was some junk character was getting added to the file name,so it was not able to open file,i just altered the file name removed the last junk character str[i-1]='\0';now the file open properly...
Since its in the list box user keep on cliking on items and open any number of files but i want only file to be open at a time..
when the user clicks on the item i want the open file to closed(txt files) and slected file to opened is there any way to close and then open a file ??
please let know if there any way
|
|
|
|
|
vinaycool wrote: when the user clicks on the item i want the open file to closed(txt files) and slected file to opened is there any way to close and then open a file ??
You have to trace the running processes and get the Handle of the NOTEPAD.exe which is the default application of the .txt files and terminate that process before executing the ShellExecute.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
use
CString FName123;
char str123[100];
FName123="test";
wsprintf(str123,"%s",FName123);
--------------------------
or
str123[0]='\0';
strcat(str123,FName123);
whitesky
|
|
|
|
|
Hi,
I have used this code its workin thank you very much
strcpy(str, (LPCTSTR) FName);
strcpy(str, FName.GetBuffer(100));
|
|
|
|
|
Just this will do:
strcpy(str, FName);
You don't need the (LPCTSTR) cast; it will be called automatically. Having a cast you don't need (especially c-style casts, which should never be used in a C++ program) is at best redundant and can even be dangerous.
Calling GetBuffer is not needed and should not be done without a matching call to ReleaseBuffer anyway.
Steve
|
|
|
|
|
Hi !!!
You can try to use this.
1.) str = FName.c_str();
2.) str = (char[])FName;
I hope, I helped you.
By.
-:KNOX:-
|
|
|
|
|
I get the emule source about 4.50 MB
But I do not know how to complie it ?
Who can help me ?
Thks
my email is
fisheryj # gmail.com
|
|
|
|
|
And what is the problem exactly ? Normally, you should have a projet file that you can open and then simply compile the project.
What version of visual studio are you using ? I think eMule was developped with VC2003.
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
I use vc 2005 to complie it
but it say no some header file
--------------------------------
fisheryj # gmail.com
jerry
|
|
|
|
|
Geez, when you have a question, at least take the time to explain CLEARLY the problem ("This doesn't work" is not a clear description of the problem). We are not gods and so we cannot see what happens on your computer.
I suppose you get a compile error ? Give the exact error message and give as much information as you can.
jerry11111 wrote: but it say no some header file
What I am supposed to understand from a sentence like that ?
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
I hear it need another library file.
--------------------------------
fisheryj # gmail.com
jerry
|
|
|
|
|
Hi,
Post your Q properly if u need a solution ...dont just leave the important information just give just & some on the message...
|
|
|
|
|
Hi,
(Windows XP)
When I run the App.EXE , a windows firewall message appears which says would you allow to run this application or what to block it or remind later.
How can I handle this programaticaly that this message should not appear when I run my application
Thanks
Regards.
|
|
|
|
|
zahid_ash wrote: How can I handle this programaticaly that this message should not appear when I run my application
do u want to programmatically add it to the firewall's list of allowed program?if that is the case you can use the netsh DOS command to add App.Exe to the list of allowed programs.
"Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"
|
|
|
|
|
Could you please exactly tell me how to use this netsh Dos commend - thanks
or any link
Regards.
|
|
|
|
|
(sorry)
I think that's one of the points of a firewall - to prevent unwanted .exes from running. If there was a way to circumvent this programatically, that would defeat the purpose of the firewall, right?
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
Hi,
when using Clipboard.SetDataObject()in my source code, I got the error 'Clipboard': undeclared identifier.
If I add the lines below,
using namespace System::Reflection;
Clipboard = new Clipboard();
Clipboard.SetDataObject(...);
I got 'System is not a class or namespace name' and other errors.
Any advise???
Thank you in advance
|
|
|
|
|
|
That looks suspiciously close to .NET code to me. They don't support much .NET in the realm of c++ so most of us probably haven't a clue.
According to MSDN it says...
"No example is available for C++. "
You'll have to talk to Mr. Tom Archer about that one. He's got a hardly convincing remark about why that is on Microsoft's C++ home page. Ironically, Mr. Archer has a good tutorial on clipboard usage (in native code) here at CP.
|
|
|
|
|
How can i change the main frame shape in MFC?
|
|
|
|
|
|
SetWindowLong(m_hWnd, GWL_STYLE, GetWindowLong(m_hWnd, GWL_STYLE) & (~(WS_CAPTION | WS_BORDER)));
CRect rect;
GetWindowRect(&rect);
int w = rect.Width();
int h = rect.Height();
CRgn rgn1;
rgn1.CreateEllipticRgn(// Your parameters);
SetWindowRgn(static_cast<hrgn>(rgn1.GetSafeHandle()), TRUE);
rgn1.Detach();
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
See Here[^] maybe it is some helpful to you
whitesky
|
|
|
|