|
okay.. so I use this?
if(ar.IsStoring())
...
else
...
where do I put this then?
if (m_ldFile.DoModal() == IDOK)
{
// Get the pathname selected
m_filePath = m_ldFile.GetPathName();
...
I just don't get on how to use the serialize function to open file. And how do I have this data to the view part?
|
|
|
|
|
ReturnRain wrote: okay.. so I use this?
if(ar.IsStoring())
...
else
...
You misunderstood Serialize function. Serialize function is the place where you do the writing to a file to make your document data persistent.
if( ar.IsStoring() )
// Write here code for saving your data
else
// Write here code for loading data
You don't have to worry about opening and closing the file it's done for you by Doc/View architecture. CArchive contains a valid open file. So you need to just use the overloaded << and >> operators.
Well if you have a byte array you have to use CArchive::Write .
Since you said you have an MDI application, you should have File, Edit and other menus.
|
|
|
|
|
okay.. thanks!
and since MDI have a different class for doc and view, how do I get the data from doc to view? i want to store the data in an array that I have declared in view.
|
|
|
|
|
ReturnRain wrote: and since MDI have a different class for doc and view, how do I get the data from doc to view? i
Call CYourDocument::UpdateAllViews .
From MSDN:
Call this function after the document has been modified. You should call this function after you call the SetModifiedFlag member function. This function informs each view attached to the document, except for the view specified by pSender, that the document has been modified. You typically call this function from your view class after the user has changed the document through a view.
|
|
|
|
|
ReturnRain wrote: Do I need to use the serialize function?
You can, but it's certainly not a requirement. The document holds the data, regardless of how it is acquired. The view renders said data.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I have build a dll in release mode on my developer machine. It gets registered there. I copy the dll on the release machine at the same location where the installer of the application puts other dlls in place. The outcome of this is that it overwrites the existing dll with the one that I had copied. Now this dll is being loaded by an exe in the same directory. I think before the dll can be loaded it has to be manually registered. When I try to manually register the dll it fails. Could someone tell me why is this happening.
|
|
|
|
|
tom groezer wrote: When I try to manually register the dll it fails. Could someone tell me why is this happening.
What does it say?
|
|
|
|
|
This is the message that I get LoadLibrary failed. The application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this application.
|
|
|
|
|
Check for dependency using dependency walker. ("Program Files\Microsoft Visual Studio\Common\Tools\DEPENDS.EXE")
Regards,
Paresh.
|
|
|
|
|
You need to ship dll's that are required by dll you are trying to register.
As already suggested by Paresh , use dependency walker to list the required dll's.
Prasad
MS MVP - VC++
|
|
|
|
|
What version of compiler are you using?
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
|
|
|
|
|
hi,
I am new to this forum
Is there any API available to write the data in the BIOS.
Eager to see from u
Thanks, and regards,
KSMH
KSMH
|
|
|
|
|
I am unable to understand the difference in both the pointers, managed one with __gc and unmanaged pointer, please refer to the program and let me know the differences between them, and what is the advantage of _gc * coming for one time or coming for two times an how much difference it can make to the garbage collection or how much advantageous is it?
__gc struct G
{
int i;
};
__value struct V
{
int i;
};
int main()
{
// defaults to V __gc * __nogc * ppV;
V ** ppV;
// defaults to V __gc * __nogc * __nogc * pppV;
V *** pppV;
// defaults to G __gc * __gc * ppG;
G ** ppG;
// defaults to G __gc * __gc * __nogc * pppG;
G *** pppG;
// defaults to G __gc * __gc * __nogc * __nogc * ppppG;
G **** ppppG;
}
Thanks,
Syed
|
|
|
|
|
Please answer the followings :-
[1] What does Outlook Express supports Simple Mapi, CMC, Extended Mapi?
[2] Does Simple Mapi, CMC supports UNICODE?
I am getting a return value CMC_E_FAILURE from function cmc_query_configuration(). What can be the reasons?
Regards,
Sameer.
|
|
|
|
|
ccpptrain wrote: Please answer the followings :-
Do I get a toffee?
found at bash.org
[kernx]|.|.|.|.|.|.|.|
[kernx]sorry, wrong window
[beox33]say me why in the f*ck will you type that in any window
|
|
|
|
|
hi i am newbie...
i am a bit confused in socket programming.
my question is..
how can we communicate thru sockets between two different Ips as these two ip are have their internal IP and external IPs.
suppose that communication shud be between A and B.and A and B are having their internal and external IPs.
1. how the server(A) shud listen (ok it will listen to port x)?.if the client(B) connect to external IP of A..will that each to the server A?
2.if server (A) sends a message to Client (B) on B`s external IP will that reach the client B?
any one please pull me out of this confusion . plz point out if i am wrong or suggetst me how can i wright socket application ( chat for examaple) between these two IPs those of each are having two IP`( internal and external).
--Thanks in advance.
hi
|
|
|
|
|
A Socket needs an IPAddress to communicate with its another peer.
1. It doesnt care whether it is External (PublicIP) or Internal (LAN)(hope my
interpretation of internal and external is right) it is handled by the DNSserver (publicIP) or your LAN GateWay.
2. Once the Connect--listen-- accept sequence is over, you can exchange messages between any two connected sockets.
regards,
haribabu
|
|
|
|
|
namithakathi wrote: how can we communicate thru sockets between two different Ips as these two ip are have their internal IP and external IPs.
Let's start inside the LAN, here your two peers communicate using the internal LAN IP addresses.
It gets a little bit more difficult when you communicate outside the LAN and the internet IP address (external IP address) is different to the LAN IP address (internal IP address). Generally two peers on the internet have to communicate via their external IP adresses, typically the router or the proxy does a kind of network-address-translation for you. For example if your internal IP address is 192.168.1.1 it could from the outside look like as you would have an external IP address 87.164.52.42. This network-address-translation often works automaticaly for the outgoing traffic (depends on your network setup), but it usually does not work automatically for incoming traffic (internet to LAN).... aka "firewalled computer".
Hope this helps for a start.
|
|
|
|
|
Once all thread started from the main thread. I have put the follwing wait message
in main thread to handle the child thread.Means until completed all the child threds Main thread must be wait.
for that I had put.
WaitForMultipleObjects(2, hThread, FALSE, INFINITE);
will it stop the messagepumping ?
because when thread reach at the following line .
<br />
SendMessage(hwndCmbProfile,CB_GETCURSEL,0,0);<br />
The application does stop the working .In Task manger it shown application not responding.
Is WaitForMultipleObjects affect on os message pumping??????
why the application get hang??
"Success lies not in the result , But in the efforts !!!!!"
Amit Mistry - petlad -Gujarat-India
|
|
|
|
|
amitmistry_petlad wrote: will it stop the messagepumping ?
If you don't start any new thread, your application has only one thread. It means that if you do something that takes a lot of time, your application will not respond during this time, because the message loop is in the same thread. Thus, if you wait for something in the main thread, your application won't respond (unable to process messages) until the wait is terminated and until you are able to process messages once again.
|
|
|
|
|
Firstly this line looks funny:
WaitForMultipleObjects(2, hThread, FALSE, INFINITE);
If hThread is thread HANDLE , as the Hungarian prefix suggests, then this should not compile. It looks like you're just waiting on one HANDLE . I'd guess hThread is a pointer to an array of HANDLE s: if this is the case the "h" prefix is confusing and will throw programmers that are aware of Hungarian prefixes.
Secondly, no message pump is running so the SendMessage in the worker thread will (and should) block. What you need is the MsgWaitForMultipleObjects function. Look in the ATL source code in the function AtlWaitWithMessageLoop for an example of its usage.
Steve
|
|
|
|
|
Stephen Hewitt wrote: I'd guess hThread is a pointer to an array of HANDLEs:
You are right sir ,
this is an array of HANDLES.
Plese look at here sir,
<br />
for(...)<br />
{<br />
<br />
<big>hThread[i] = (HANDLE ) _beginthreadex(NULL, 0, &Thread, l, 0, &tid)</big>}<br />
"Success lies not in the result , But in the efforts !!!!!"
Amit Mistry - petlad -Gujarat-India
|
|
|
|
|
Messages sent to a window must be processed by the thread that created the window. When a worker thread calls SendMessage() , it blocks until the message handler returns. Since the message is going to a window (assuming it was created by the main thread, which is uaually the case), the thread that has to handle the message is blocked and can't run, so you've created a deadlock.
You also have a bug in the call to WaitForMultipleObjects() - you say you're passing 2 handles, but only providing one.
|
|
|
|
|
Thank you sir,
How can I stop the deadlock situation? and child therad SendMessage to the window.
"Success lies not in the result , But in the efforts !!!!!"
Amit Mistry - petlad -Gujarat-India
|
|
|
|
|
You should avoid the use of SendMessage() between threads; if the receiving thread is not processing messages your application will deadlock.
Use PostMessage() instead.
Read more here[^].
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|