|
Hi All,
Just wondering if anyone knows a simple way to reuse an existing form view as a dialog, without having to create a new CDialog derived class from scratch to do it.
Thanks,
Aaron
|
|
|
|
|
It's not possible to reuse CFormView as a dialog. What should be possible is to embed a dialog (modeless) in a CView derived class (not CFormView) and alternatively using as a modal one.
Pavel
Sonork 100.15206
|
|
|
|
|
Hi guys.
Do you know a simple way to identify uniquely a computer independently of the OS? What can I use in MFC to do this?
Best Regards
|
|
|
|
|
think that exists some key on registry (i dont know where)
if you have all your windows licensed you have no problem , use the
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProductId
if this is not the case then i think you can use:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\InstallDate
it will be very dificult (almost impossible) to find two pc with the same installdate on a local network (anless you have used norton ghost or somenthing like that)
Casa.Sapo.pt
|
|
|
|
|
its better to consider the Disk Volume label/processor ID
there s various API s to query the details..
WUSIWUG
|
|
|
|
|
I would recommend using the same mechanism that is in use for networking... the MAC address of the machine's NIC. Every NIC ever manufactured has a unique MAC address, no matter what hardware it goes into or what operating system runs it. These have to be unique, otherwise networking protocols would not work.
Take a look at the GetAdaptersInfo() function in the Windows Platform SDK. It's probably the easiest way. Note that this is a Win32-specific mechanism. Unfortunately, there are no universal C/C++ standards for working with network protocols. It's an OS-specific thing and every platform has its own method for doing so.
Ty
"The significant problems we face cannot be solved at the same level of thinking we were at when we created them." -Albert Einstein
|
|
|
|
|
Hi,
I have multiple Dialog and I need a Timer to trigger a timing event (it should work at any time & any where)
For now I do the following, and have big problem:
1) In Main dialog I have a ListControl box, I SetTimer(1, 5000, NULL) for 5 seconds trigger in OnInit()
2) I use WM_TIMER to create OnTimer(...), in here I display a ListCtrl items (after changing their values), and "only display" if I am sure I am "at the Main Dialog"
3) Before display the listctrl, I did use DeleteAllItems() to clear the listview!
*) If I do not switch the Main Dialog to others, it works perfectly! But even I switch once & coming back rightaway ... my listctrl is not response as before (never refresh) ... even it did get in the OnTimer() ... some thing weird happens very fast & un-controllable!
I hope that someone know the real problem ... or tell me how I use another SetTimer method!
I am really appreciate any help & suggectons here, I stuck to this issue for more than 3 days!
Many thanks,
|
|
|
|
|
can u give the code which u try there...
i think thats bcz of expiring the scope of the object...how u call the dialogs..?? be specific..and give the code if u can..
WUSIWUG
|
|
|
|
|
Hi renjith,
Please see more Update detail in my new post, it will explain where is the real problem. Here is some parts of my codes:
a) In OnInit() of Main.cpp:
{
f_Main = true;
CWnd::KillTimer(TimerNumb);
TimerNumb = CWnd::SetTimer (1,5000, NULL);
}
b) In OnTimer() of Main.cpp:
{
cnt++;
// Toggle every Timer trigger
if(!f_toggle)
{
f_toggle = true;
ListControl(f_toggle);
}
else
{
f_toggle = false;
ListControl(f_toggle);
}
}
c) In ListControl(bool flag):
{
LVITEM listItem;
listItem.mask = LVIF_TEXT;
listItem.iSubItem = 0;
// Only Refresh Screen when in the Main GUI
if(f_Main)
{
m_cnt = cnt;
m_list.DeleteAllItems();
if(ON)
{
m_toggle.SetCheck(true);
int row = 0;
UpdateData(false);
while(row < 10)
{
listItem.iItem = row;
listItem.pszText = "dummy";
m_list.InsertItem (&listItem);
m_list.SetItemText (row, 0, "Hello");
m_list.SetItemText (row, 1, "Hello");
m_list.SetItemText (row, 2, "Hello");
row++;
}
}
else
{
m_toggle.SetCheck(false);
UpdateData(false);
}
}
UpdateData(false);
}
|
|
|
|
|
Please mail me your workspace..
My ID is rrenjith@m2comsys.com
WUSIWUG
|
|
|
|
|
Hi,
I have more detail about the problem:
1) It still work, but when the Main Dialog going back "once" the Timer event still 5 seconds ... but happen "twice" (even)! Because of that, if it the list ON next time it still ON (not toggle)
2) If the GUI coming back the "second time" the Timer still 5 seconds but happen tripple (odd), now the listctrl is toggled!
*) That means the more switching Dialog, when the Main dialog coming back: the more event happen in the same 5 seconds interval!
I did try to kill the Timer, before trigger again, but failled! Here what I did in OnInit() of Main Dialog
CWnd::KillTimer(TimerNumb); // kill previous Timer
TimerNumb = CWnd::SetTimer (1,5000, NULL); // re-trigger
**) I did monitor the TimerNumb, and it equals 1 at any time!
***) If I set a flag & not re-trigger SetTimer(), it will not work any more (after switching to other dialog & coming back) ... I do not know why the Timer is gone, even I do not kill it any where???
if(!f_reset) TimerNumb = CWnd::SetTimer (1,5000, NULL);
f_reset = true;
With these situation, might be someone can help me how to do the task in the first place?
Many thanks,
|
|
|
|
|
I hope this isn't too hard - but how can I get the source of a HTML page given the IHTMLDocument2 pointer to it? I know I can get the body which supports the innerHTML property but that only gives me the source of the body - the head section is not there.
Anyone?
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
Nevermind - found it out myself:
<br />
IHTMLDocument2Ptr piDoc = ...;<br />
IPersistStreamInitPtr piPersistStreamInit;<br />
IStreamPtr piStream;<br />
HGLOBAL hGlobal = NULL;<br />
<br />
::CreateStreamOnHGlobal( NULL, TRUE, &piStream );<br />
piDoc->QueryInterface( IID_IPersistStreamInit, (void**)&piPersistStream );<br />
piPersistStream->Save( piStream, FALSE );<br />
<br />
::GetHGlobalOnStream( &hGlobal, piStream );<br />
<br />
size_t nNumBytes = ::GlobalSize( hGlobal );<br />
if ( nNumBytes > 0 )<br />
{<br />
BYTE* pBytes = reinterpret_cast< BYTE* >( ::GlobalLock( hGlobal ) );<br />
if ( pBytes[0] == 0xFF && pBytes[1] == 0xFE )<br />
{<br />
LPCWSTR pszwHTML = reinterpret_cast< LPCWSTR >( pBytes + 2 );<br />
}<br />
else<br />
{<br />
LPCSTR pszHTML = reinterpret_cast< LPCSTR >( pBytes );<br />
}<br />
::GlobalUnlock( hGlobal );<br />
}<br />
<br />
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
I am writing an application right now in VB 6.0. I was just wondering if someone could help with this. Upon the FormLoad() function, I need the program to call a notepad file (main.ini) and read the third line and replace a variable inside of my program. Can somebody please please help me????
Thanks again,
Bob
|
|
|
|
|
Bad forum . Warning: VBers hated here .
Pavel
Sonork 100.15206
|
|
|
|
|
BHBAD2002 wrote:
Can somebody please please help me????
Yeah! I can tell ya to not cross-post and ask in the appropriate forum. Like say, it's a VB question, so maybe your luck will change in the, gee I don't know, the Visual Basic / VB.NET forum maybe.
Jeremy Falcon
Imputek
<nobr>"In fact it is quite simple, men and women both only want one thing - what they can't have!" - phykell
|
|
|
|
|
I think it will need ADOX, but are there any links/samples that show how to merge database1 and database2 to create a final database. The number of fields in each db is different, and some of them are distinct, though some overlap.
Thanks,
ns
|
|
|
|
|
Do you mean merging seperate databases or seperate tables? Can you provide more information about your database format etc.
Michael
Programming is great. First they pay you to introduce bugs into software. Then they pay you to remove them again.
|
|
|
|
|
EAch access database has one table. SOme of the fields overlap. I need to merge these two different databases, so that the new one has all the fields (union of), and whatever field was not present in database 1, should have entries "abc", likewise if the field wasnt present in database2, those records should have entries "abc" too. I suppose one could at first check and see which fields are different, then use ADOX for each database to add the new fields and populate them. So now we have two dbs with identical fields (different number of records of course). Now how to merge these two databases so the final one has one table in it which is the sum of the tables from db1 and db2.
Hope this is clearer...
Thanks,
ns
|
|
|
|
|
Do you just need the result or do you actually need a program that does this.
If itst the result you're looking for. Do it in Access by importing data from one DB into the other ( or import both into a new DB). Create a table with all the fields you want. Use Insert queries to move the data from the old tables to the new one.
Even if you need to be able to repeat the process. I'd recommend doing this in Access. Just write a VBA script to do the job.
|
|
|
|
|
Unfortunately I have to do this with code as a feature of another program. I'm using MFC...
|
|
|
|
|
Its too bad you have to do this in VC++. That will be the most ineffective language to use.
Your original post posed this question:
are there any links/samples that show how to merge database1 and database2 to create a final database
I can't imagine that there are. That's a pretty odd thing to do to databases. Using MFC or anything else, the process will be as I described earlier. I have seen code samples of creating a new database and tables from VC, but I can't remember exactly where. With a little effort you should be able to find examples of each of the steps.
Good luck,
Bill
|
|
|
|
|
I have a list control object and I add a notification handler for double-clicks (VC.NET). The problem is that I never receive the notification.
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
AFAIK, WM_LBUTTONDBLCLK won't work for list box'es!
Use the following:
ON_LBN_DBLCLK(IDC_MYLISTBOX, OnDblclkMyListBox)
If you are using Wizards, it generates this code. There shouldn't be any problems.
Mustafa Demirhan
http://www.macroangel.com
Sonork ID 100.9935:zoltrix
<nobr>They say I'm lazy but it takes all my time
|
|
|
|
|
Is there a possibility to create a MetafileDC without clip region ? All metafiles derived from ClientDC or ScreenDC have an implicit "desktop-size" clip region.
My problem:
Metafiles, created from our graphic displays, do not include all graphical objects, if the graphic display has dimensions larger desktop size. Missing are WMF-based objects, which are drawn by PlayEnhMetafile(). Debugging shows, that these objects are processed and that PlayEnhMetafile() does not return an error.
I assume, that the WMF data is clipped, if these objects' origin are outside the device dependent clip region.
The problem would be solved, if I could define a MetafileDC with a clip region equal to the dimensions of the graphic display.
|
|
|
|