|
I have copyed all the mfc dll to the system32 but no use
Then I install the sp1 for the visual studio 2005 then all the OK.
thanks for your reply. 
|
|
|
|
|
Am new to WTL, but why am I having so much problem adding a normal toobar to my simple dialog based app ? It seems to be easy with a Frame, but not a dialog as far as I can see. I can see quite a few people asking this question, but not any reasonable examples - but I may be missing them.
|
|
|
|
|
Dialogs only provide limited functionality, their job is really to just host a few controls. I can't say for certain but I'm guessing this may be the reason you are having problems. That is Dialogs and Toolbars just don't go go together. I do know that when starting with WTL Dialogs seem less daunting than say, CWindowImpl. I did a search of my WTL/ATL code and all toolbars I've implemented have been on CWindowImpl based windows. Maybe it's time to move on from a Dialog based app.
|
|
|
|
|
hi guys, i'm having problem passing the value of color picker to my COLORREF variable..
my code on KEYDown Event:
CGDICarSampleDlg.cpp file
/*
CColorDialog dlg;
if (dlg.DoModal() == IDOK)
{
color = dlg.GetColor();
}
Invalidate();
*/
when the color picker apears, i just choose a color,.
i created a brush on my Car.cpp file,
m_brCar.CreateSolidBrush(RGB(0, 0, 255));
now my problem is this, how do pass whatever the value of chosen color to a COLORREF variable, then pass it to m_brCar.CreateSolidBrush(COLORREF variable);?
so when i chose a color, my CAR DRAWING changes it's color, initialy the color is BLUE..
thanks ahead..
|
|
|
|
|
ok, i resolved it on my own...
using these three lines of code i was able to extract the RGB...
r = GetRValue(color);
g = GetGValue(color);
b = GetBValue(color);
haha... google is a friend, don't be shy to ask GOOGLE..
|
|
|
|
|
Hi ,
I developed a new OCX in VC++ 2008 , it is working .i want to rename the OCX. how to do that. Pls give u’r suggestion .
Now my OCX file name is “IPCalling.ocx”, rename to “IPCall.ocx”
Thanks
shakumar
|
|
|
|
|
you can simply rename the ocx file, but should register it again (either manually or using RegSvr32.exe) to work properly.
|
|
|
|
|
This may or may not work depending on how the registration code is implemented: if it hard codes the name of the exe it will not.
Steve
|
|
|
|
|
I just guessed that he wasn't writing the acitveX from scratch and didn't hardcode any file names in his own DllRegisterServer 
|
|
|
|
|
That's true , but to register an ActiveX, the full path of it is needed: using an hardcoded one, means that to work properly, the ActiveX must reside on a specific folder (the one that the programmer had choosen)...
It's too much better to let unmodified the registration code generated by the Application Wizard, as it uses the GetModuleFileName function. 
|
|
|
|
|
yes.. thats what i exactly meant and what he might have already done! 
|
|
|
|
|
Thanks for u’r reply
Finally I able to rename the OCX file .it is working fine in my test application.
But my requirement is , I am already having “IPCall.ocx” , now I created new “IPCalling.ocx” and i try to rename to “IPCall.ocx” but i cant.
so i created another new OCX application in name of “IPCall.ocx” and include the all files , methods & property as older OCX and applying older OCX GUID CDECL to new it is working in Test application.
But when I applying to main application this new OCX rise error
Error : 339:component ’ IPCall.ocx’or one of its dependencis not correctly registered: a file missing or invalid
I registerd the OCX file & it is working in Test application which is tested by the older OCX file.. But not working in main application.
How to check the "missing dependencis in new OCX".
or
list all dependencis in older OCX so ill compare to new and if it is missing i will include.
Regards & Thanks
shakumar
modified on Friday, September 3, 2010 9:40 AM
|
|
|
|
|
if you just want to only change the name of output binary, why don't you cahnge it in Project Properties->Linker->General->Output File. ?
As you could successfully register the ocx, there is rare chance to miss the dependencies. still to make sure on implicitly linked dependencies, if any, use tools like 'Dependency Walker'
|
|
|
|
|
Looking for c++ winsock example code that will enable the following: Allow for multiple clients each on a different machine ie different ip address to connect in. I would like to listen on the same port for all clients and also once connectivity is established be able to send and receive using this same port for each and all the connections.
Currently, with the code I have written connections seem to get established and I initially receive data from the client but when I attempt to send to client I do not get any errors but the client isn't receiving my message either. Then when viewed in Wireshark I see that the messages are associated with "ezmessagesrv". Something to do with unknown caller.
One question, the server socket I use to establish the bind and listen, once the accept returns successfully with the new client socket connection should I close the server socket (the one I use to do the listening) and reinitialize before attempting to listen for other client connections?
|
|
|
|
|
Have a look at Beej's guide to networking programming[^], there are client/server examples in chapter 6.
Another starting point is the Winsock Programmer's FAQ[^], it has examples in section 6.
Regarding a server, the normal way would be opening a server socket, calling bind and listen and then accepting incoming client connections. You do not close the server socket, while more incoming connections are expected. Here is a code fragment (your code could look different, but the principle stays the same):
void CSocketServer::OnAccept(int nErrorCode)
{
CAsyncNetwork::OnAccept(nErrorCode);
CAsyncNetwork* pSocket = new CAsyncNetwork;
if(Accept(*pSocket))
{
m_listSockets.push_back(pSocket);
} else {
delete pSocket;
}
}
CSocketServer server;
server.Open();
server.Bind(4242);
server.Listen();
Hope this helps.
/Moak
|
|
|
|
|
Does anyone know Interface of Microsoft DataGrid Control?(ActiveX Control)
WTL Application
Enable Activex Control
CAxWindow wndAtlAx = getdlgitem(ID_DATA_GRID_ACTIVE_X_CONTROL);
wndAtlAx.querycontrol(?)
I try IDataGrid... there is no similar COM Interface name in C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include.
how can i use DataGrid in WTL?
thanks.
|
|
|
|
|
did you use 'OLE-COM Object Viewer' that comes with visual studio tools to explore the interfaces of the ActiveX control? have a try.
|
|
|
|
|
What would be the best way to have a C++ program write(append) to a file and at the same time have a Visual basic program read sequentially all that's been written and when it reaches EOF wait for more? How would file/record locking be used to accomplish this?
|
|
|
|
|
A named pipe would be a good candidate for this requirement.
The C++ program can create and write to the pipe - CreateNamedPipe /WriteFile .
The VB program can open and read from the pipe - CreateNamedPipe /ReadFile .
|
|
|
|
|
|
Options in increasing order of complexity/robustness:
- Those mentioned, uncontrolled access by both apps/threads.
- LockFileEx() / UnlockFileEx() - OS level read/write locking, critical if multiple threads will be appending.
- Transactional NTFS - TxF API to perform transacted reads/writes, critical if multiple writes to different data sources (file, registry, database) may need to be rolled back and readers need consistant view across all.
...cmk
The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying.
- John Carmack
|
|
|
|
|
Hi everyone,
I have an ActiveX control (or simply say a COM control) which was used within some applications so far.
As a new requirement this control should also be running within the browser.
So far so good, it works quite flawless.
But when a page including the control is opening, the bar for activating activeX is shown every time. This is not really great user experience if the prompting is done with every new browser session again and again.
Furthermore I have some cases where the current <object>-element is created at run-time. In this case the prompting is not done at all, the object is simply not initializing (except if you have allowed activeX within the same browser session before)
So my question is: Can I install my control in such a a way that IE allows showing it whout prompting? Maybe simply signing the DLL? Registering it as BHO? (All BHO-related stuff I found was gui-less, so it did not help me so far.)
How are plug-ins for IE developed usually? As I said, BHO offers no examples for content controls, maybe there is some NAPI-like interface for this? Has somebody usefull ideas how to develop a content control such as Flash that is simply installed and running in the browser without any prompting?
Thanks,
Roland
|
|
|
|
|
|
In a form, I am having a message map at the Tab-level like below:
ON_NOTIFY_RANGE(DTN_DATETIMECHANGE, DLG_CTRLBASE, DLG_CTRLBASE + DLG_MAXITEMS_CTRL, OnDateTimeChange)
From TabCtrl::OnDateTimeChange(), I have a call to next level DataFormDlg::OnDateTimeChange
TabCtrl::OnDateTimeChange
{
DataFormDlg->OnDateTimeChange;
}
Inside DataFormDlg, I have another message map as below
ON_NOTIFY_RANGE(DTN_DATETIMECHANGE, DLG_CTRLBASE, DLG_CTRLBASE + DLG_MAXITEMS_CTRL, OnDateTimeChange) and the function is
DataFormDlg::OnDateTimeChange ()
{
//body
}
Now when I click at the datepicker control, the DTN_DATETIMECHANGE event is triggering twice. So, the TabCtrl -> DataFormDlg -> OnDateTimeChange() is executing twice.
Could you please help me finding what is going wrong here?
Thanks,
modified on Wednesday, August 11, 2010 3:00 PM
|
|
|
|
|
Can I suggest you post this question to the correct forum, rather than this one, which doesn't cover MFC...
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
CodeProject MVP for 2010 - who'd'a thunk it!
|
|
|
|