|
Thanks again for replying.
Can you show me what you mean? Are you talking about a message map?
|
|
|
|
|
|
Hi
Will like to ask if anyone has ever try opening a comport with baudrate other than those even in Microsoft APIs? like BaudRate of 141250 etc?
I have a device that will work best with this baudrate but could not set the comport baudrate to this value for communication?
|
|
|
|
|
The Windows API supports any baud rate, but the driver and COM port usually only support a standard set of baud rates (integer factors of 115200; a legacy hardware limitation). If your COM port and driver supports other baud rates, then Windows won't stop you using them.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
As Ryan says, the standard PC hardware supports a maximum of 115200 bit per second, as well as half that (57600), one quarter (28800), 14400, 9600, 4800, etc. Thus 141250 is not available with standard hardware.
I made an interface a few years ago which used two Intersil 6502 UARTS, with different crystal oscillators for each and a little bit of glue logic components - receiving on one UART triggered transmission on the other, so this converted between different baud rates. No buffering or anything, so you had to "go slow".
Try posting on the hardware forum - maybe some of the USB-to-serial adapters allow strange rates like you need.
|
|
|
|
|
Hi,
I have a few dialogs, icons, bitmaps, strings that I've localized in the
following way:
I've created a separate resource only dll which has a separate RC file for
each language.
This project also has a different build configuration for each language.
So that in that configuration only that dll will build and the resources
pane in the project properties will be set to the proper culture for each
build configuration.
I am loading that dll from a COM c++ dll in the following way:
m_hDll = ::LoadLibraryEx(filename.c_str(),NULL,LOAD_LIBRARY_AS_DATAFILE);
ATLASSERT(m_hDll != NULL);
ATL::_AtlBaseModule.SetResourceInstance(m_hDll);
AfxSetResourceHandle(m_hDll);
It loads successfully and loads the correct file.
For all the languages, but german, everything else also works good.
Issue #1
For german, DoModal throws an access violation.
Debugging MFC shows that this line throws the exception :
hWnd = ::CreateDialogIndirect(hInst, lpDialogTemplate,
pParentWnd->GetSafeHwnd(), AfxDlgProc);
hInst, lpDialogTemplate, AfxDlgProc are all fine and valid adresses.
m_hWnd of the pParentWnd is not :
m_hWnd CXX0030: Error: expression cannot be evaluated
At first I was getting an assertion failure in the MFC code, in
COccManager::CreateDlgControls, on the following lines :
if(pOccDlgInfo->m_pItemInfo[i].nId)
{
COleControlSiteOrWnd *pTemp = new COleControlSiteOrWnd(::GetDlgItem
(pWndParent->GetSafeHwnd(), pOccDlgInfo->m_pItemInfo[i].nId),
pOccDlgInfo->m_pItemInfo[i].bAutoRadioButton);
ASSERT(pTemp->m_hWnd);
}
After a couple of reruns it became an access violation.
The interesting part is that if I switch to a non german regional setting
and load the german resources file, it works.
Once the regional settings are set to german loading any language resource
file produces the same failure on DoModal.
I've compared the build configuration settings and the rc file to the other
languages and their rc and definitions.
It's all the same besides the language setting parts...
Any ideas ?
What to look for ?
Can it be a problem with the german language pack installtion ???
Issue #2
The other problem is for all the languages :
One of the ctrls of the dialog is an ATL Composite Ctrl which comes from
another project. It is supposed to show the text TEXT.
What happens is that my dialog shows the language extension, according to
the culture in my regional settings, right before that text:
<fr>TEXT
or
<ru>TEXT
Where does that come from ? How do I get rid of that ?
--
Thank you!
|
|
|
|
|
I want to react upon the ESC key during a loop is processed to give the user a chance to abort the current operation which might take some time. Since the processing of the loop takes most of the cpu capacity, message processing seems to be delayed until the loop is finished. Any idea how to solve this?
|
|
|
|
|
Either peek for messages periodically during your processing, or put processing into a separate thread, but you still have to check against an 'aborted' flag periodically - which would be set by the UI thread which received the ESC key.
People that start writing code immediately are programmers (or hackers), people that ask questions first are Software Engineers - Graham Shanks
|
|
|
|
|
|
Man that is cool!
Regards,
Rajesh R. Subramanian
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
|
|
|
|
|
why dont u make the "lengthy operation" as a seperate thread?....i think that should sove the prob!
cheerz!
"faith, hope, love remain, these three.....; but the greatest of these is love" -1 Corinthians 13:13
|
|
|
|
|
I need a global object so that all other objects can access it. Could somebody help?
Thanks
|
|
|
|
|
Just declare and define it outside any object or function. e.g.
<br />
int g_Global;<br />
<br />
extern int g_Global;<br />
Note the extern in the .H file, without this you'll get link errors (symbol multiply defined). All files that want access to the global include the .H file with the external reference.
Steve
|
|
|
|
|
Thanks a lot. I will have a try.
|
|
|
|
|
Another approach, and one I favor over the 'global object' is to declare the instance of the object in one place, as a static.
Then write a function that returns the address of the 'globally accessible' object.
Look at how the CWinApp is defined and implemented in MFC for a decent example. You call a fucntion AfxGetApp to obtain the pointer to the object, rather than accessing the object by name directly.
People that start writing code immediately are programmers (or hackers), people that ask questions first are Software Engineers - Graham Shanks
|
|
|
|
|
Hi
I'm talking about this neat feature that treates your code like a tree and lets u see just the branches u want while the others are hidden behind a [+]
Is there anything like that in any VC6 addin?
TIA,
|
|
|
|
|
|
I mean the objects that belong to different classes.could anybody tell me what the simplist method is, and what the best method is?
Thanks in advance
|
|
|
|
|
One object should hold the data and the others point to it.
|
|
|
|
|
Thanks. but in case one object does not own a pointer to another object, how to share data between them?
|
|
|
|
|
You could share data with a global variable or if the classes have a common base class through a static member of the base (this is really a variation on the global). None of these is, in general, particularly good form. If you need to share data between classes then one should hold a pointer or reference to the other. If this isn't possible your design probably needs revising.
Steve
|
|
|
|
|
I would create an intermediary class that can 'connect' the two and has the appropriate Get/Set functions on its own member variables. This essentially allows your two objects to share the data with each other. You can add ability to inform each of the clients assuming they have some mechanism permitting notification, such as they are a thread or a window object.
This object would allow the two to also share data independent of their individual implementations.
People that start writing code immediately are programmers (or hackers), people that ask questions first are Software Engineers - Graham Shanks
|
|
|
|
|
Yeah, this sounds fine. Obviously an entity needs to exist which has pointers/references to the two classes which need to share data.
Steve
|
|
|
|
|
The two classes have some reference to the intermediary object, not the other way around.
However, if either class has a LOT of data, you would not want to keep copying that around. But then if they need to share a lot of data that frequently, neiher of the clients should possess the data in the first place - the data SHOULD reside in the intermediary object - a data repository object.
Each client then uses its own mechanism, or a parent object hooks everything up.
Typically, when a question like this is posed, I immediately think there is no or little separation of data from processing, and every system I have ever encountered that is made that way, suffers from upgrade and migration problems not too distant in its future.
People that start writing code immediately are programmers (or hackers), people that ask questions first are Software Engineers - Graham Shanks
|
|
|
|
|
how abt applying the friend class concept?
"faith, hope, love remain, these three.....; but the greatest of these is love" -1 Corinthians 13:13
|
|
|
|