|
Code-o-mat wrote: You said that you tried the download aproach already but there were problems with the URLs. What problems? Could these maybe handled by Wininet's InternetOpenURL[^] function?
Yes,some url not the true url for some website's setting,if I want to get the true URL of those image ,may be need parse the URL again. but this seem not the problem at present.With your patient explain,I think I should download the image in order to get the original image.
Thanks Code-o-mat again.
notenking
|
|
|
|
|
Good morning,
last week I already wrote about my little problem. Then I got sick and and couldn´t take part in the conversation. Even though I got an answer it didn´t help (or I misunderstood). Now I wanted to ask/clarify and would be glad for some help.
The code:
SOCKET m_oUDPSocket;
SOCKADDR_IN m_oUDPAddress;
.
.
.
m_oUDPSocket = socket(AF_INET,SOCK_DGRAM,0);
memset(&m_oUDPAddress,0,sizeof(SOCKADDR_IN));
m_oUDPAddress.sin_family=AF_INET;
m_oUDPAddress.sin_port=htons(m_iClientPort);
m_oUDPAddress.sin_addr.s_addr=inet_addr(m_sClientIP.data());
.
.
.
int rc=sendto(m_oUDPSocket,(char*)packet,size+12,0,(SOCKADDR*)&m_oUDPAddress,sizeof(SOCKADDR_IN));
The problem: I´d like to send the data via 'sendto' ALWAYS on the same outgoing port.
The question: Where and how do I define this outgoing port? Do I have to create another SOCKADDR_IN with the server port and address and bind it to m_oUDPSocket?
Like this?
SOCKADDR_IN addr;
memset(&addr,0,sizeof(SOCKADDR_IN));
addr.sin_family=AF_INET;
addr.sin_port=htons(desiredPort);
addr.sin_addr.s_addr=INADDR_ANY;
rc=bind(m_oUDPSocket,(SOCKADDR*)&addr,sizeof(SOCKADDR_IN));
Or am I on the wrong path here? And how can I test if it indeed sends from the desired port?
Thanks for any help.
Souldrift
|
|
|
|
|
What do u mean by outgoing port?
Normally the ipaddr and the port number on which u need to send the data will be fixed.
client must have the PortNo and Ipaddr to send the data in UDP to server.
|
|
|
|
|
Well, by outgoing port I mean simply the UDP port. The question was, how do I get a fixed one?
By now I figured that it is the 'bind' command that will do that. Though, what UDP port does the server use if I do NOT specify a bind?
Regards
Souldrift
|
|
|
|
|
IIRC random between 1024 and 65535, or maybe between 50k and 65535
|
|
|
|
|
Yes, thanks. It was just that I hadn´t thought of binding the socket to a certain port (like I mused in the second code block of my initial post). Now it´s working.
Cheers
Souldrift
|
|
|
|
|
I need to store my data into database from C++ using Pure C++ with out using MFC Classes can any body help me out or any links so that i can browse for API's.
|
|
|
|
|
POCO[^] has data access libraries. Have a look at Poco::Data namespace.
|
|
|
|
|
There are many ways to do this. You may use, for instance, ODBC API [^], or you may go through ADO [^] (You've also the option to embed SQLite [^] in your application).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
you can ask on Professional Win32 api newsgroup :
news://nntp.aioe.org/comp.os.ms-windows.programmer.win32
or http://tinyurl.com/cmhb5g by Google
for all methods (MS and others, pure Win32 code...)
|
|
|
|
|
Not sure what you mean by "pure" C++, but in any case you'll need some external library to access a database; database access is not covered by standard C++.
|
|
|
|
|
In our project, we have a MFC screen. In this screen, we have 2 buttons along with other controls. One button is OK and otherone is Cancel button.
In this screen when focus goes to the "Cancel" button, it get stuck on it.
After focusing on Cancel button, Tab does not work and focus does not move to any of controls on the screen.
It is something like when focus goes to "Cancel" button, Tab is not working.
Please help to resolve this issue.
modified on Monday, August 3, 2009 8:31 AM
|
|
|
|
|
By default, this should not happen. What code do you have in place that would be handling the tab key or the WM_SETFOCUS message? Have you created a new "test" application to see how it behaves, and then start adding your app-specific code until the problem appears?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
I want to fetch excel data and store in database .how it is possible
Trioum
|
|
|
|
|
A quick search with CP's article search engine: [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
trioum wrote: how it is possible
By telling us exactly where you are having trouble: fetching Excel data, or storing data in a database.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
In our project, we have a MFC screen in which tab order is as follow.
Textbox1, Textbox2, combobox1, checkbox1, combobox2, combobox3.
Here tab order works fine upto checkbox1.
Now if my focus is on checkbox and I press tab, focus goes to the Textbox1 instead of combobox2.
If I change me TabOrder as follows, it works fine.
Textbox1, Textbox2, combobox1, combobox2, combobox3, checkbox1.
It means there is some problem with checkbox control.
Please help me to know what could be the issue.
|
|
|
|
|
your tab order is wrong. Re-arrange the tab order. It works fine for me
|
|
|
|
|
Thanks for looking into the issue but I have re-arranged it many time and its not working.
One thing I want to add is that when I Test the screen using Layout-->Test, it works absolutely fine. But when I run the application its not working properly.
|
|
|
|
|
check the properties of the checkbox and tell me if you have checked some of the property values.
i dont see a reason why the tab order will not work if you have provided the tab order properly.
|
|
|
|
|
Visible,TabStop,Auto properties are checked and all the others are unchecked.
|
|
|
|
|
|
Have you read the forum guidelines before posting the query.
And have you worked on VC++ before?
|
|
|
|
|
Dear all,
I am developing an application with VS2008, MFC 90.
There was an exception:0xC015000F: The activation context being deactivated is not the most recently activated one.I can not handle it.
The following is my call stack:
ntdll.dll!7c944a17()
[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]
ntdll.dll!7c944a17()
user32.dll!7e418734()
user32.dll!7e418bd9()
user32.dll!7e41885a()
user32.dll!7e418822()
user32.dll!7e4189cd()
> mfc90d.dll!AfxInternalPreTranslateMessage(tagMSG * pMsg=0x7e4189f0) Line 242 + 0x14 bytes C++
user32.dll!7e440457()
user32.dll!7e4196c7()
mfc90d.dll!AfxInternalPumpMessage() Line 183 C++
mfc90d.dll!CWinThread::PumpMessage() Line 900 C++
CapsvrTx.exe!CCapSvrRoot::LoadConfig(IUnknown * pICaller=0x00000000, int bRemoteSetup=1, int bMessagePump=1) Line 4716 + 0x20 bytes C++ // this is my function.
Your reply will be deeply appreciated.
Best Regards.
Lance
|
|
|
|
|
Hi Lance,
I encountered the same issue 3 days ago with an MFC based application running on Windows7. I do not fully understand the problem but Junfeng Zhang over at Microsoft has described the situation which causes this error. You can read about it here:
SXS Activation Context --- Activate and Deactivate[^]
I was able to disable the exception by adding the following line in my Applications InitInstance().
afxAmbientActCtx = FALSE;
I do not know if there are any unwanted side-effects by adding this line. I am still researching the this issue.
Best Wishes,
-David Delaune
|
|
|
|