|
When I call SetName on my activeX control with some danish character (æøå) as parameter I get some wired text in my Edit control. How can I solved this problem?. Thx in advance.
test.h
afx_msg void SetName(LPCTSTR name);<br />
DECLARE_DISPATCH_MAP()<br />
test.cpp
<br />
BEGIN_DISPATCH_MAP(CMyMFCCtrl, COleControl)<br />
DISP_FUNCTION(CSignScanMFCCtrl, "SetName", SetName, VT_EMPTY, VTS_BSTR) <br />
END_DISPATCH_MAP()<br />
<br />
<br />
void MyCtrl::SetName(LPCTSTR name) <br />
{<br />
std::string myname = name;<br />
}
CMyDialog dlg = new CMyDialog();<br />
dlg.m_name = myname.c_str();
void CMyDialog::OnInitDialog() <br />
{<br />
CString defaultText = m_name;<br />
SYSTEMTIME systemTime;<br />
GetLocalTime(&systemTime);<br />
<br />
char formatDate[20];<br />
memset(formatDate, (char)NULL, sizeof(formatDate));<br />
<br />
sprintf(formatDate," %4.4d%2.2d%2.2d %2.2d%2.2d", <br />
systemTime.wYear, <br />
systemTime.wMonth,<br />
systemTime.wDay,<br />
systemTime.wHour,<br />
systemTime.wMinute);<br />
<br />
defaultText += formatDate;<br />
SetDlgItemText(IDC_DESCRIPTON_EDIT, defaultText);<br />
}
|
|
|
|
|
Wild guess. Are you building an MBCS version, or a UNICODE version?
If the former, there may be an implied WideCharToMultiByte() happening somewhere which is unable to convert the Danish characters to MBCS encoding, and they are showing up as boxes or similar.
Steve S
Developer for hire
|
|
|
|
|
hello!
i need an articles to know com object? where i start ?
please help me.
Zo.Naderi-Iran
|
|
|
|
|
Have you tried this[^] as a starting point?
Steve S
Developer for hire
|
|
|
|
|
Thank you
Zo.Naderi-Iran
|
|
|
|
|
hello!
how to replace an ActiveX with our created ActiveX?
do it possible?
Zo.Naderi-Iran
|
|
|
|
|
In theory, yes. You have to know which class objects (in the COM sense) and interfaces the ActiveX supports, and then you could update the information in the registry to load your component instead. Having read your next question, that might take some time...
Steve S
Developer for hire
|
|
|
|
|
Using the MessageClass property on a MailItem object, I can check if it is an Out of Office reply by comparing it to "IPM.Note.Rules.OofTemplate.Microsoft".
Does anybody here know, if this is a feature that is supported by Lotus Notes, and if so, what would the string be for an Out of Office reply?
"God doesn't play dice" - Albert Einstein
"God not only plays dice, He sometimes throws the dices where they cannot be seen" - Niels Bohr
|
|
|
|
|
Hi,
I am having a issue in creating a substorage with more that 32 characters as it name(Substorage name). I came to know that the limitation of IStorage->CreateStorageEx is this issue. But is there any other way so that i can break this barrier. I think microsoft is doing this(Breaking the barrier). Can anyone help me in this. Thank you,
Manu
Manu
|
|
|
|
|
I have composed and built a Service DCOM using ATL(vC6.0), also a ClientApp.
They can work well when they run at the same computer. Problems start to arise, when i install the Server to another computer.
the interface i design is custom, but i've alreay install the _ps.dll both in
Server and Client computer.
who can help me on how to install DCOM.
|
|
|
|
|
Yaki_15 wrote: Problems start to arise,
What problems, exactly?
0. Have you enabled DCOM on both machines?
1. Have you registered your DCOM service on the remote machine?
2. Have you checked that the access/launch permissions are correct on both machines?
3. Have you checked that the client is configured to talk to the server?
Supplementary questions;
What identity is your service launched as?
What identity is your client launched as?
Have you used explicit security (security blanket) or are you using DCOM registry settings?
Steve S
Developer for hire
|
|
|
|
|
Steve S wrote: 0. Have you enabled DCOM on both machines?
1. Have you registered your DCOM service on the remote machine?
2. Have you checked that the access/launch permissions are correct on both machines?
3. Have you checked that the client is configured to talk to the server?
Supplementary questions;
What identity is your service launched as?
What identity is your client launched as?
Have you used explicit security (security blanket) or are you using DCOM registry settings?
Firstof all, Thanks aton for your advising questions. Aatually I didn't kown
to install a DCOM shuould take so "many"(i use many 'cause each is to much for me to crack through) essentials into consideration. To tell your the true, i am a beginer with DCOM, I've just finished serval key and basic cousres on COM subject,such as COM Principle, IDL , Objcet Module... those courses discuss little on the issues you put forward. anyway, your reply does help alot to me, at least it let me know where i am on the way to succeed in DCOM. Maybe before i start to compose a Service, i need to load up
some knowledge about NT Security,right? I wander if you can advise me some helpful books or Website on this subject.
|
|
|
|
|
Steve S wrote: What identity is your service launched as?
What identity is your client launched as?
Have you used explicit security (security blanket) or are you using DCOM registry settings?
Steve S wrote: 0. Have you enabled DCOM on both machines?
i don't know how to enable DCOM.
Steve S wrote: 1. Have you registered your DCOM service on the remote machine?
i am sure i have done this step.
Steve S wrote: 2. Have you checked that the access/launch permissions are correct on both machines?
how to do this?
Steve S wrote: 3. Have you checked that the client is configured to talk to the server?
can i do this by using stucture COSERVERINFO AND COATHNINFO?
as to the Supplementary questions, i think i still need your help.
|
|
|
|
|
0. Enable DCOM
OS specific. For XP, you run dcomcnfg from the command line or the 'Run...' prompt. In the tree in the left pane, expand component services, then computers.
Right-click 'My Computer' in list (probably only entry) and select properties.
In 'Default properties' tick 'Enable Distributed COM on this computer'.
2. In DCOMCNFG, under 'My Computer' (see above), there's a 'DCOM Config' option.
This lists apps which are registered. (You need entries on the client for this too) and you can set permissions and locations.
Q: Are you using explicit location by specifying COSERVERINFO etc at launch time, or using DCOM 'default' settings (from the registry/DCOMCNFG)?
Q: If you're running XPSP2, is the firewall running?
With a f/w, you have to tell DCOM which ports to use, and punch the appropriate holes in the firewall.
Steve S
Developer for hire
|
|
|
|
|
Steve S wrote: Q: Are you using explicit location by specifying COSERVERINFO etc at launch time, or using DCOM 'default' settings (from the registry/DCOMCNFG)?
i am using explicit location by specifying COSERVERINFO etc at launch time,
i have already shut down firewall for both local and remote machine which are
both running xpsp2.
|
|
|
|
|
they can work now. thank you, Steve S
|
|
|
|
|
See here[^] maybe it is some helpful to you
|
|
|
|
|
Here i am developing a application which require to fetch Time from database . But i am getting 00:00:00 AM as a time everytime. We are using MySql database.
Code fragment is....
========================================================
_variant_t vtValue;
vtValue = RsSession->Fields->GetItem("StartTime")->GetValue();
COleDateTime d( vtValue );
sprintf( name, "%02d:%02d:%02d",d.GetHour(),d.GetMinute(),d.GetSecond() );
========================================================
in "name" i am getting "00:00:00" ..everytime.. All the other values i am retrieving from ResultSetPtr are OK.
Can any one tell me what is to be done ther ....
Thanks in advance
Prafulla Vedante
E-Mail : prafulla_v@asianitg.com
|
|
|
|
|
This is what I use:
COleDateTime timField;
_variant_t varValue;
varValue.Clear();
varValue = m_pRecordset->Fields->GetItem(strFieldName)->GetValue();
if ( varValue.vt == VT_DATE ) //lint !e1036 !e569
{
timField.m_dt = varValue.date;
timField.SetStatus(COleDateTime::valid);
}
else
timField.SetStatus(COleDateTime::null);
|
|
|
|
|
sorry jerry but it doesent work at my side
it still gives me 00:00:00 .
Data type of "StartTime" in database is "time"
Prafulla Vedante
|
|
|
|
|
Hi guys
We are working in ASP.Net Environment and most of the time we are facing 1 problem as follows
I have 1 aspx page, in that i have 2 frames now in the sacond frame i have "main.aspx" page is running in that i have Logoff button on click of that i want to redirect to Home.aspx page but if i use Response.Redirect("Home.aspx") then my Home page gets open in the second frame and my 1st frame that is my top frame remain as it is
So what i want is like when we use hyperlinks then we specify the nevigate page and then the target (where to open this link)
Eg: Navigate Page = "Home.aspx"
Target = "_parent"
then it get open that Home page in the browser.
So can we do the same kind of thing in the ASP.Net by using Response.Redirect
Please help me guys
Regards,
Harshad Pednekar
|
|
|
|
|
In an asp.net application, I use a COM object... this COM objects is stored in the session.
The COM object has methods that can last a long time (it sends info through a socket and wait for the reply). My problem is whenever I call a method of the COM object, it is always in the same thread which means that multiple users can block themselves out ( I know: I log the thread ID).
The COM threading model is apartment.... which should be OK.
All threads in asp.net are MTA.... which should be OK.
But the whole thing is not OK.. any idea? Thanks!
|
|
|
|
|
Hello BadJerry,
Although all threads in asp.net are MTA-based, your COM object remains an STA object. Hence at runtime, when your COM object is created, an STA apartment will be created (whose thread is the one for which you have tracked the ID) and the COM object will live there.
If your have the source codes for your COM object, you can change the apartment type to MTA but you must of course modify your code to make it suitable as an MTA object (using CRITICAL_SECTION objects, etc).
If you do not have the source codes to the COM object, I suggest creating an MTA object that exposes the same interface but internally aggregates all interface method calls to the original COM object. This should allow the asp.net client to make calls to other methods while the long time-consuming method is underway.
Hope the above helps,
Bio.
|
|
|
|
|
The above really helped... I thought the apartment threading model was MTA and it was STA... It took a bit of time to move my object to MTA... changing a #define, the inheritance from the com objects and the .rgs file but it is all done and it now works!
There was also the fact that AfxGetThrread()->m_nThreadID was incorrect which threw me but in the end, it works!
Thanks again for taking the time to write your message!
Bad(StillButABitBetter)Jerry
|
|
|
|
|
Hello BadJerry,
I'm really glad that things worked out
Best Regards,
Bio.
|
|
|
|