|
Depends on what you need to display. You can always call ::MessageBox() for complete control, or use the MFC class members to hide away the details of hwnds, etc. as the situation requires.
<marquee scrollamount="3" scrolldelay="80" direction="right" width="40%" style="border: 2px inset silver;background-color:yellow;color:green;font-family:Verdana,Arial;font-size:8pt;font-style:italic">onwards and upwards...
|
|
|
|
|
I really don't know where else to ask this question but it is more a Windows Installer related question.
I built a simple program with VC6 (that's why in the subject I put not very VC++ related, b/c it is only 0.0000001% related) and I want to give it to someone who is not into computers. To make his job easier I built an installation file using windows installer. Even though, this is the very first time I used windows installer everything works fine. When I run the program from its shortcut in the START->PROGRAMS->MYAPP menu, it won't find the files that the program uses for input/output. The files are there and I know this has something to do with the shortcut, but I really don't know how to fix it. I ran into this problem 2 years ago and I don't remember how I fixed it. The thing is that right now I am pressed for time because I need to send this the day after tomorrow.
// Afterall I realized that even my comment lines have bugs
|
|
|
|
|
Use Innosetup (you can downlaod it for free). In about 10 minutes, you should have your installation file settled up with file extensions registration and shortcuts taht are working fine.
~RaGE();
|
|
|
|
|
I have the shortcuts and the program runs just fine up to the point where it has to read a file which is located in the applications directory. I think my problem has to do with some registry settings because when a program runs from a shortcut something tells me that it considers as the running directory the shortcut's directory. I really don't have a problem with building the installation file.
// Afterall I realized that even my comment lines have bugs
|
|
|
|
|
OK. Then I would suggest to do the following (MFC):
use GetCommandLine() to retrieve your .exe path (Parse the string for that)
use SetCurrentDirectory to set the .. current directory to the one you have found out.
This should solve the problem.
~RaGE();
|
|
|
|
|
Rage wrote:
This should solve the problem.
Until the user opens a file that is not in that directory, and the File Open dialog box changes the current directory.
A more robust way is to get the exe path with GetCommandLine() like you said, and then open the data files from that directory, rather than relying on the current directory, which the user can change at any time.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
VSI is not particularly good for creating shortcuts. I got around this by coding my program so that it found out what directory the main exe file was in, and then looked for the data files in the same dir. It fixes the symptoms, not the underlying problem, but it does work.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
< TARGETDIR >\*.exe
set the Traget property of ur shortcut(for Exe) if ur usig install shiled for MVC++6.0
hope it'll work for u...
nice time
Adi
|
|
|
|
|
Thank you for your help everyone. I will try your suggestions and I will let you know.
// Afterall I realized that even my comment lines have bugs
|
|
|
|
|
Well Rage and Ryan Binns, your advice was very helpfull and it worked perfectly. Thank you very much. Thank you for your reply Adi, but I am not using InstallShield so I couldn't try your suggestion.
// Afterall I realized that even my comment lines have bugs
|
|
|
|
|
i create a new single document project with wizard,and the name of the project name is MyProject.after execute the proprame, the caption of the window is
"untitled:1-MyProject"
Now i ask how to remove the sign ":"?
gucy
|
|
|
|
|
You need to override the SetTitle() function member of your CDocument-derived object.
|
|
|
|
|
i did so,but the string ":1" is still there
|
|
|
|
|
hello......
u can set the title of the application window in InitInstance() function of the SDI application class....
u'll have m_pMainWnd as member variable... all u've to do is
m_pMainWnd->SetWindowText("MyProject");
or go to string table and change IDS_APP_TITLE Caption to Myproject......
try the first one...which is better
Adi
|
|
|
|
|
This is strange, as a default SDI, or even an MDI, application would have a caption of Untitled - MyProject. It sounds like you've changed something to get the additional ":1" in the caption.
Now to get rid of the "Untitled - " part of the caption, simply add the following to your CMainFrame::PreCreateWindow() function:
cs.style &= ~FWS_ADDTOTITLE;
|
|
|
|
|
The :1 indicates the view number of of the document is open in the current session (MDI-related).
For more details, look at the MFC source code file WINFRM.CPP, function
void CFrameWnd::UpdateFrameTitleForDocument(LPCTSTR lpszDocName)
<marquee scrollamount="3" scrolldelay="80" direction="right" width="40%" style="border: 2px inset silver;background-color:yellow;color:green;font-family:Verdana,Arial;font-size:8pt;font-style:italic">onwards and upwards...
|
|
|
|
|
I knew I'd seen the :1 before but since I've probably only written 3 MDI apps since they were introduced, I couldn't pull it from memory. Even so, I've not ever needed to open two of the same window! Most of what I do revolves around dialog boxes, and SDI apps, or no UI at all.
|
|
|
|
|
Hi !
I have a Handle on a process for which I'd like to change the priority. For this, I use the SetPriorityClass, but it fails, and it seems (with a GetLastError) that my aplication doesn't have the rights to change the priority of the process. (I'm running it on WinNT)
Anyone knows how I could change the priority ?
Thank s for your help!
Jérôme
|
|
|
|
|
You need to use AdjustTokenPrivileges() to enable the PROCESS_SET_INFORMATION access right. There are a few examples of how to do this in the docs.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
hey,
We want to synchronize a memory area with a file on disk.
I did the following steps:
- CreateFile(...,CREATE_ALWAYS)
- CreateFileMapping(FileHandle)
- pdata* <= MapViewOfFile(MapHandle)
then I use memcpy to write data to the file.
When I write a buffer to pData that is larger then the filesize, the buffer is truncated to the file size.
So I want the file to grow dynamically in size.
There is an api func DeviceIoControl with param FSCTL_SET_SPARSE to accomplish this, but this only seems to work on win 2000 with NTFS 5.
Anyone has an idea to accomplish this behaviour?
Thanks in advance.
|
|
|
|
|
Hi ,
I am trying to read some data from a tab delimited text file taking individual field values from text file and putting it into an access databse.I have 2 recordsets one that fetches data from Text file and the other is that inserts the values into the data base.The code after opening the recordset successfully is something like this.
if(rs.IsBOF())
return false;
rs.MoveFirst();//rs IS THE RECORDSET THAT FETCHES RECORDS FROM DATA FILES
while(!rs.IsEOF())
{
recset.AddNew();///recset IS THE RECORDSET THAT FETCHES RECORDS FROM DATAFILES
recset.m_A = rs.m_A;
recset.m_R = rs.m_R;
recset.m_Absolute = rs.m_Absolute;
recset.m_Relative = rs.m_Relative;
recset.m_Class = rs.m_Class;
// recset.m_Azimuth = rs.m_Azimuth;
// recset.m_Int = rs.m_Int;
//recset.m_Box =rs.m_Box;
recset.m_2002D = rs.m_2002D;
recset.m_2002H = rs.m_2002H;
recset.m_1993D = rs.m_1993D;
recset.m_1993H = rs.m_1993H;
recset.m_Growth = rs.m_TXT_Growth;
recset.m_Growth2 = rs.m_TXT_Growth2;
recset.m_Growth3 = rs.m_TXT_Growth3;
recset.m_Wt = rs.m_Wt;
//recset.m_Comment = recset.m_Comment;
if(!recset.Update( )){
AfxMessageBox("Record not added.");
return FALSE;
}
rs.MoveNext();
}
My problem is that some members like m_azimuth(type-CTime) and m_Int,m_Box(type-CString) are not being copied to access recordset and not being updated to Access and Update function is unsuccessful.all other members are numbers and they don't have any problem copying.One CString object m_class is being copied without any problem.
The commented code shown above is working well ,but if i uncomment these portions Update function fails,Can nebody tell me what may be the problem?
|
|
|
|
|
I don't use CRecordset class but I use ADO recordset and I had the exact same problem that you are describing. My problem was that the fields that I was updating were set to null, so I had to go and change their status flag manually to "Field OK".
The problem was that every new row that you add to your database has to have values that are initialized to some acceptable value. For strings for example it would be a good idea to initialize them to a space " ". Let's say that you have a table with three fields:
fieldInt | fieldDbl | fieldStr |
When you want to add a new row to this table you should initialize these fields first.
recordset.fieldInt = 0;
recordset.fieldDbl = 0;
recordset.fieldStr = " ";
// Then do some stuff like changing the values of these fields with the data that you get from the file.
recordset.AddNew();
I hope you understood this confusing description. And by the way, I looked at CRecordset class and probably you should call the function IsFieldNull() to check the fields.
// Afterall I realized that even my comment lines have bugs
|
|
|
|
|
I have found that the MFC database classes SUCK. You may be better off doing one of the following:
1) If the name of your text file doesn't change, create a Linked Table in access to your text file. Then, you can use access insert/select statements to copy the data.
-or-
2) build your own insert statement from the retrieved data and execute it against access, rather than using all of the overhead crap of CRecordSet.
<marquee scrollamount="3" scrolldelay="80" direction="right" width="40%" style="border: 2px inset silver;background-color:yellow;color:green;font-family:Verdana,Arial;font-size:8pt;font-style:italic">onwards and upwards...
|
|
|
|
|
This huge workspace was originally developed in VC++ 6, now in 7 with some c# code in it. 46 projects in all. Huge thing. Bloated, badly architectured. I need to count the lines of code there are. Would like also to know other statistics (% of lines which are comments, whitespace, etc). Is there any free add-in or tool I could use? New to the whole .net thing, catching up with some books right now.
Thanks!
Juan Miguel
|
|
|
|
|
Look at www.wndtabs.com for the line counter
|
|
|
|