|
how to creat a setup project that will install an application through a wizerd ?
how to creat DNS programatically (driver name that we manually make in DB projects)?
how to logoff and login programatically ?
r00d0034@yahoo.com
|
|
|
|
|
imran_rafique wrote:
how to creat a setup project that will install an application through a wizerd ?
Use a setup creation software like InstallShield, Wise or a free Inno Setup[^].
Pavel
Sonork 100.15206
|
|
|
|
|
Hello @all!
How can I program a if-queries, whether a dialog still exists?
Lucky
|
|
|
|
|
You could use function IsWindowVisible() to determine if the dialog box is visible and in general can check its status. Otherwise, you coud set a boolean variable the parent class could call to get the status of the dialog box class.
Kuphryn
|
|
|
|
|
Thanks....the idea with the boolean variable is perfekt.
Lucky
|
|
|
|
|
[Sorry for my english]
Hi, i don't know if this question has been posted before.
I'm trying to make a simple calculator in Visual C (typical exercise of visual basic).
The problem is I would like to use only one function to all of the numerical buttons (those that simply adds a number to the display).
This is a problem more common that it seems, many controls and only one function for handling them.
How the function could know what button has called it?
thanks!
|
|
|
|
|
It all depends on how you are implementing your calculator.
If you are using MFC or WTL, you can make the click event for each button on your calculator call the same handler function and test the ID of the button in order to know which button was pressed.
If you are using plain Win32 API, in your wndproc function, you can have each click event call the same function, and the function would also pass in the ID of the button that was clicked.
{By the way, your english is fine)
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
If you want an example, just mail me back, and I will send it to you
LPCTSTR Dutch = TEXT("Double Dutch ");
|
|
|
|
|
Hello,
I have a quick question regarding CFileDialog..
I have a SDI type app with a "Settings" dialog box.. I allow the user to click a browse button with in the settings dialog box and select a .wav file as a sound/alert setting (using CFileDialog). The problem is that when the user selects the .wav file my current working directory changes to the path of the .wav file, so, if I do a "save" behind the scenes it saves my document to the same directory as the wav file not the directory of my .exe.
How can I prevent the current working directory (my .exe dir) from being set to the CFileDialog directory??
Thanks,
Rob
|
|
|
|
|
How can I get the directory that the .exe sits in on startup?? GetCurrentDirectory will not work. Is there another way?
|
|
|
|
|
Give this a shot.
_TCHAR drive[_MAX_DRIVE];
_TCHAR dir[_MAX_DIR];
_TCHAR fname[_MAX_FNAME];
_TCHAR ext[_MAX_EXT];
_TCHAR path[_MAX_PATH];
::GetModuleFileName(NULL, path, _MAX_PATH);
_tsplitpath(path, drive, dir, fname, ext);
CString sFolder = CString(drive) + dir;
|
|
|
|
|
Perfect... Thanks a bunch!
Rob (Bonehead)
|
|
|
|
|
i know, i have posted this question some days ago ...
but this example :
CHARRANGE cr;
cr.cpMax = LONG_MAX;
cr.cpMin = LONG_MAX;
richedit.SetSel( cr ); // move selection to the bottom
richedit.ReplaceSel( (LPCSTR)string ); // insert your text
// force the rich edit to scroll to the bottom
richedit.SendMessage( SB_BOTTOM, NULL, NULL );
doesn't work correctly. (for richedit)
Maybe anybody else knows, how ara many clients prints channel text (mIRC, Client, etc... )
it would be better give some examples (full sources of small exampl-programs) ...
thanks
----------------------------
never stop coding.
|
|
|
|
|
sorry, the topic is "irc like textoutput" ... nevermind ..
----------------------------
never stop coding.
|
|
|
|
|
You could try this
CString strRecvd;
m_cRichEdit.GetWindowText(strRecvd);
if(strRecvd.IsEmpty())
m_wndMonitor.SetWindowText(strMessage);
else if(!strRecvd.Right(1).CompareNoCase("\n"))
m_cRichEdit.SetWindowText(strRecvd + strMessage);
else
m_cRichEdit.SetWindowText(strRecvd +"\n"+ strMessage );
m_cRichEdit.SetSel(-1, -1);
m_cRichEdit.SendMessage(EM_SCROLLCARET);
Hope it helps
Rob
|
|
|
|
|
Hello,
I'm trying to implement a CListCtrl that will add items from a database but for some reason (that I can't figure out) the CListCtrl is adding only blank strings. My code is as follows:
for (i = res.begin (); i != res.end (); i++) {
dateinfo = *i;
lvi.mask = LVIF_TEXT;
lvi.iItem = j++;
lvi.iSubItem = 0;
lvi.pszText = (LPTSTR)(LPCTSTR) dateinfo["created"].c_str ();
m_listDate.InsertItem (&lvi);
} I've checked the lvi.pszText attribute of the LV_ITEM struct and it contains the string right before the call to CListCrtl.InsertItem .
Any ideas as to why blank strings are being added? Any help is much appreciated.
Thanks
- monrobot13
|
|
|
|
|
A quick addition to the stuff above. As you probably guessed I'm using the CListCtrl in report mode but if I use it in list mode and just use CListCtrl::InsertItem (int nItem, LPCTSTR lpszItem) the text inserts fine but it isn't one long list which is what I need. Just thought I'd let you all know that. As well if anyone knows a way to make a CListCtrl in list mode just have one long list (instead of scrolling sideways) I could just do that instead.
Thanks again.
- monrobot13
|
|
|
|
|
|
ARGH! Nope, I didn't even think of it. If I set the style not to have column headers will I still need to add the column? I only ask because I did set it to have no column headers and it still wouldn't work.
Thanks Again!
- monrobot13
|
|
|
|
|
monrobot13 wrote:
If I set the style not to have column headers will I still need to add the column?
Yes, without columns there's no place for the list to display any data.
--Mike--
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Alright, thanks for the help Mike.
- monrobot13
|
|
|
|
|
hello!
i want to read a .txt file after i clicked a button in a dialogbased mfc-program.
can somebody give me an example code or links or tipps?
somebody gave me a short overview (here in this forum), but i make mistakes and don´t understand everything.
The overview:
create an ifstream object
call open
set file pointer to end using seekg
call tellg to get the number of bytes in the file
allocate that number of chars
set file pointer to beginning using seekg
call read
call close
Thanks
Sunny
|
|
|
|
|
If you're using MFC then it is easier to use CFile or CStdioFile to read the contents of a txt file.
CFile file("C:\\foo.txt", CFile::modeRead);
file.Read(...)
Make sure to check for any errors.
modified 12-Sep-18 21:01pm.
|
|
|
|
|
thanks for your reply.
i tried your idea, but what must i write behind the file.read(..??..).
i read inside the help: read(void* lpBuf, UINT nCount).
i tried several things, like file.read(*buffer, 50), file.read(buffer, 50), etc...
but each time it was wrong.
where is my error?
sunny
|
|
|
|
|
I do it like this..
CString strBuff;
CFile file;
if(file.Open(_T("anyfile.dat"),CFile::modeRead))
{
char cBuf[2048];
UINT uBytesRead;
while(uBytesRead = file.Read(cBuf, sizeof(cBuf)-1))
{
cBuf[uBytesRead] = NULL;
strBuff += CString(cBuf);
}
file.Close();
...
}
else
{
}
Hope it helps
Rob
|
|
|
|