|
Hello!
y Build an application using visual studio, but i don´t know what extra files do i need for execute de applicatión in a different machine
Sergio
|
|
|
|
|
Which version of VC++ are you using?
For most applications, they will have dependency on the C Run-time dlls.
In VC++ 2003 and earlier, those CRT dlls are dropped to system32 folder and they just need to be on the path. You can figure out the names of the dlls by using depends.exe.
In VC++ 2005, the CRT dlls are now distributed through Msms that needs to be merged into an Msi to get installed on the user's machine. You can search for VCRedist.exe on the microsoft website. Again - depends.exe should help you figure out those dlls.
gmileka
|
|
|
|
|
hi guys,
im using ReadProcessMemory to read out 4 bytes of a process. The value is a DWORD. Yesterday a friend said to that I should use a Pointer opperation to read out the memory. I read a bit about Pointer and Memory allocation but i didn´t get it working.
I tried this:
DWORD dwAddress = 0x01234567;
DWORD *dwValue = *(DWORD*)dwAddress; // got the address of dwAddress
DWORD dwValue = *(&dwAddress); // got the address ( 0x01234567 )
How can i read out the value ?
|
|
|
|
|
Is this value in the process that is doing the 'read' or is it in a different process?
If it's in the same process, then assuming that 0x0BADC0DE is the virtual address of the DWORD you want to fetch, the following code will get it:
<br />
DWORD dwAddress = 0x0BADC0DE;<br />
DWORD dwValue = * reinterpret_cast<DWORD *>( dwAddress );<br />
If you specify an invalid virtual address, you will generate an access fault at runtime. This technique is generally used only in very low-level code that does not run in a virtual memory space to access memory-mapped hardware devices. It's not something that is very useful in a Windows Application and it would generally be considered very poor programming style.
If you need to read memory in a different process, then you must use ReadProcessMemory(). Each process has it's own self-contained virtual address space. There is no way to define a simple pointer into the address space of another process.
If you are in control of the source for both processes then you could set up shared memory between the two, or possibly some other mechanism for getting the value. Can you tell us a little more about what the value represents, how often you need to read it, etc? More information might let us suggest a better method of sharing this value.
Dan
Remember kids, we're trained professionals. Don't try this at home!
|
|
|
|
|
i have an app with a login dialog box, with login button, when the button is pressed the login dialog box hides and new dialog box opens. When i click cancel in the new main dialog box, the dialog box disappears but the app is still running in the background in taskmanager. is it becuase the login dialog box is hidden and not closed or ??? how do i close the hidden dialog box if that is the problem or is it summit else?
regards
keith
void CKeithDlg::OnLogin()
{
ShowWindow(SW_HIDE);
CMainDlg Dlg;
Dlg.DoModal();
}
========================================
void CMainDlg::OnCancel()
{
CDialog::OnCancel();
}
|
|
|
|
|
CKeithDlg hides itself but doesn't close itself, so the app is running with a hidden main window. IIUC you want the app to exit after CMainDlg closes, right? At the end of CKeithDlg::OnLogin() , add EndDialog(IDOK);
--Mike--
Visual C++ MVP
LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
|
void CKeithDlg::OnLogin()
{
ShowWindow(SW_HIDE);
CMainDlg Dlg;
Dlg.DoModal();
EndDialog(IDOK);
}
Manish Rastogi
|
|
|
|
|
Is it true that if GetActiveView() returns NULL then Our Application Does not Support Doc/view.or how can know
or how can check that Our Appliction Supports Doc/View
pls help me.
Fly Like An Eagle With MIGHTY POWER.
|
|
|
|
|
(1)GetActiveView() returns NULL when called for an MDI main frame window (CMDIFrameWnd).
(2)If there is no current view, returns NULL.
libo
|
|
|
|
|
I am attempting to write a front-end database app. Using relational database design I have a parent table in a CFormView in one pane of a splitter window and a child table CFormView in another pane of the same splitter window. On the OnInitialUpdate for each of the CFormView's I create and open the recordsets. I can replace a new CFormView and (subsequent recordset) into a pane based on user selection. I notice that OnInitialUpdate fires for each pane of the window regardless of whether or not the pane is being replaced. Creating some problems as I was expecting the OnInitialUpdate to only fire once.
To test this again before I posted this question, I opened up a Splitter Window example from a book (MFC Answer Book) and put some trace statements in the OnInitialUpdate event for each of the CFormViews. It appears that if a window has 3 panes, all 3 panes get the OnInitialUpdate to fire even when only one is being replaced.
Question: Is this normal behavior? Thanks.
|
|
|
|
|
Can you but a breakpoint in the view's OnInitialUpdate() method and check the stack trace at that point? That will tell you what piece of code is calling OnInitialUpdate() and why it is happening for each view.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Hi David,
I did it once and my eyes kind of glazed over. So I did it again and it makes sense now.
InitialUpdateFrame was being called in the code that switched the views and this then makes each view call OnInitialUpdate.
Thanks
|
|
|
|
|
How to write the output array to a text file?
|
|
|
|
|
chaitanya22 wrote: How to write the output array...
What output array?
chaitanya22 wrote: How to write...to a text file?
What text file?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
|
Here's one way:
FILE *pFile = fopen("file.txt", "w");
for (int x = 0; x < sizeof(array) / sizeof(array[0]); x++)
fprintf("%d\n", array[x]);
fclose(pFile); Others exist, too.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
for write to file you can use CArchive But please refer to Reply David Crow
|
|
|
|
|
if you meant the values of and array in a txt file you can use the binary files to write the whole array in it but binary mode.
f=fopen(fname,"bw");
fwrite(array,1,sizeof(int)*nr_of_items,f);
fclose(f);
but if you want the values to be readable you must convert them first to chars and then write them.
char nr[10];
/*if array declared like this int array[100] or int *array*/
f=fopen(fname,"w+");
for (int i=0;i<nr_of_items;i++)
{
_itoa(*array,nr,10);
fwrite(nr,1,strlen(nr),f);
array++;
}
fclose(f);
the main="" thing="" is="" that="" you="" can="" write="" any="" kind="" of="" data="" variable="" in="" a="" binary="" file="" otherwise="" will="" have="" to="" make="" convension="" it="" text="" file.="" sometihng="" like="" this:
1="" line="" the="" nr="" entries
2="" length="" each="" entry="" if="" they="" are="" all="" equal
3="" -=""> nr_of_items line the entries
or something like this.
have fun
gabby
|
|
|
|
|
what about CFile;
CFile a("C:\\tmp.txt",CFile::modeWrite|CFile::modeCreate);
for(int i=0;i<nSize;i++)
a.Write(m_arrString[i],strlen(m_arrString));
a.Close();
|
|
|
|
|
I am working on an application that has different features built in for parsing traffic logs for the television broadcast industry. Marketing wants to sell each feature seperately or as a full package. What would be the best way to turn on and off these features short of having to do seperate builds for each of them. Also if at a later date the customer wants to add features to his existing software without having to send them a new build.
raybert
|
|
|
|
|
There are many solutions to your problem. One way we do it at our company is run a little setup dialog first, so that the user tells what to start. Then that dialog calls the appropriate executables and passes in different command-line arguments for different features.
|
|
|
|
|
package your features in DLL, only ship the one that the client buy.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
I am verynew to Visual C++ 6, but I can write powerfull database programes with it. the only problem I have is the child form or child dialog. When I create as child I can not use the mouse but I can navigate with the tab. if I make it popup and move the mdi form it does not move with the parent.
Can some one give me hints!!
|
|
|
|
|
Salad Juris wrote: I am verynew to Visual C++ 6, but I can write powerfull database programes with it.
Yes, but it would not be a wise endeavor given your "new" status. A better solution would be to use Microsoft SQL, Access, or MySQL as the DBE, and write the front end using VC++.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|