|
Mark Salsbery wrote: I would really look at the design of the code.
I second that. Twice.
Mark Salsbery wrote: Nothing exposes bad multithread design like switching to a multi-core/multi-CPU
machine
Hear, hear.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Hi,
I know this is not the right forum but as i could not see vb forum i am posting here.
I wrote small vbscript function to add registry key and value. here is the script.
strComputer = "."
Set oReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
keyPath = "*\shellex\ContextMenuHandlers\WWBuildShell64Ext"
Return = oReg.CreateKey HKEY_CLASSES_ROOT ,keyPath
If (Return = 0) And (Err.Number = 0) Then
Wscript.Echo "HKEY_LOCAL_MACHINE\Software\MyKey\MySubKey created"
Else
Wscript.Echo "CreateKey failed. Error = " & Err.Number
End If
it is returning 6. What does it mean? how to solve this?
Regards,
|
|
|
|
|
You can ask your question on the Visual Basic[^] but I think you need to check return value of CreateKey.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Hi all,
Iam facing some strange problem with my application.
My application uses Comport to communciate with the device.
If my application only opened, I can open the serial port and close the port without any problem.
If I open my application and just close the serialport and open hyperterminal and connect it , after some work on hyperterminal again i want to switch to my application by disconnecting hyperterminal.
When I am opening the port again in my application my application hangs,
When it calls any API of comport like, SetCommState()as it is never returning from it.
Why application is hanging when hypertermianl opened and closed in between applciation open uart and close uart.
Thanks in advance..
Regards,
Sunil Kumar
|
|
|
|
|
How do you open the device?
Or in other words: what does your call to ::CreateFile() look like? (Post the code.)
Whenever you're developing software that communicates with communications port, it's usually very nice to have an application that tells you what is going on under the hood. I always use PortMon[^] written by Mark Russinovich. It will tell you exactly what Hyperterminal and your application is doing.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
It may happen if your application (wrongly) relies on some initial state of the serial device (and the Hyperterminal alters it).
As remarked by Roger Stoltz, without posting the relevant code, you hardly will get any help.
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]
|
|
|
|
|
I'd like to use owner_draw on a button, but I'd like to draw a little bit and let windows draw the left.
How can I do this?
|
|
|
|
|
If I remember correctly, you could call Default() (but I've been proven wrong many times)
In my experience, either you do it or not do it; there is no middle ground when owner drawing controls.
This signature was proudly tested on animals.
|
|
|
|
|
|
The easiest way is probably to let the button draw itself then draw over the top of it - so, call DefWindowProc at the start of your owner draw handler then do your own drawing
|
|
|
|
|
Hey guys,
Sorry to be bugging everyone with silly questions, I am just wandering I have a project that I have used VC 6 to create, and I've just recieved a message from a client saying it doesn't work on the 64 bit version of Windows.
Is there a way of getting VC 6 to compile projects that work with 64 bit operating systems or am I stuffed. If not is there an emulator software you can use that will allow 32 bit apps to run on 64 bit systems.
Any help would be greatly appreciated.
All the Best
Danny
|
|
|
|
|
Are they running on the 64-bit Itanium or something? Unfortunately VC6 is unable to produce 64-bit compatible binaries.
If your client is on a pure 64-bit architecture then you may have to compile your project with Visual Studio 2005 or higher which supports both x86-64 and IA-64 depending on the edition.
Another possible solution is to use the free compiler which comes with Microsoft Windows SDK[^] which also supports x86-64 and IA-64. This option may become a problem... especially if your using MFC.
Best Wishes,
-David Delaune
|
|
|
|
|
I think you must first understand why your 32-bit app does not work on 64-bit systems.
And VC 6 does not have 64-bit compilers.
«_Superman_»
|
|
|
|
|
A thought I had after posting the thread. Could it be the target operating system is missing the mfc42.dll? My project does use MFC.
Danny
|
|
|
|
|
Ideally all the dependencies must be part of your application's installation.
But then it shouldn't have worked on the 32-bit system either.
Mfc42.dll is not part of the OS.
It is installed when you install Visual Studio.
«_Superman_»
|
|
|
|
|
|
|
How is that going to help with VC6?
Best Wishes,
-David Delaune
|
|
|
|
|
I saw it afterwards and I thought its not good idea to delete my reply but why 1?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Hamid. wrote: I thought its not good idea to delete my reply but why 1?
Hello Hamid,
It wasn't me who down-voted your response. Want me to give 5 to bring it back up?
Best Wishes,
-David Delaune
|
|
|
|
|
No thanks but It was not bad link.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
I was actually trying to code to open multiple files with no extensions those were inside a folder. I looked up for methods but I coudn't find. Please help me with this as soon as possible. Can I do so with turbo C++??
|
|
|
|
|
|
I was actually trying to code to open multiple files with no extensions those were inside a folder. I looked up for methods but I coudn't find. Please help me with this as soon as possible. Can I do so with turbo C++??
|
|
|
|
|
I have a problem with a 3 state check box (push style) with new common controls 6.0 vista look, no problem with older common controls. I have created a very simple application of one button if someone needs the code, where I want the check box(which really looks like a push button) to behave as 3 different state, ( ON -I set to a color), (OFF- I set it to another color), (INdeterminate- I want it to be Gray or something), works fine for ON & OFF, but 3rd state, somehow the text seems to get shifted or something on the button, it shows half gray, half red..... Anyone with similar problem...here is the meat of the code...Keep in mind, it works fine if I don't use it as tri-state, or if I don't use common controls 6.0 with the linker.
Thanks
void CColoredButton::OnClicked()
{
if(!m_IsEnabled){
SetCheck(FALSE);
return;
}
if(GetCheck()==2){
ModifyStyle(BS_BITMAP,0);
InvalidateRect(NULL);
}
else{
ModifyStyle(0,BS_BITMAP);
SetColoredCheck(GetCheck(),m_FontSize);
}
WPARAM wParam=MAKEWPARAM(GetDlgCtrlID( ),BN_DOUBLECLICKED);
GetParent()->SendMessage(WM_COMMAND,wParam ,(LPARAM)m_hWnd);
}
void CColoredButton::SetColoredCheck(int nCheck,int FontSize)
{
COLORREF Color = m_UpColor;
if(nCheck==1)
Color=m_DownColor;
if(nCheck==2)
Color=RGB(255,0,0);
CString Label=GetText(FALSE);
CRect Client;
GetClientRect(Client);
CClientDC dc(this);
CDC dcMem;
dcMem.CreateCompatibleDC(&dc);
CFont* pFont = GetFont();
CFont MyFont;
m_FontSize=FontSize;
CBitmap* pOldBitmap = dcMem.SelectObject(&m_Bitmap);
CBrush brBackground(Color);
CBrush *OldBrush=dcMem.SelectObject(&brBackground);
dcMem.SetBkColor(Color);
dcMem.FillRect(Client, &brBackground);
if(!m_IsEnabled){
CBrush *PHalfBrush=dcMem.GetHalftoneBrush( );
if(PHalfBrush!=NULL)
dcMem.FillRect(Client, PHalfBrush);
}
CFont *OldFont=dcMem.SelectObject(pFont);
int OldBkMode = dcMem.SetBkMode(TRANSPARENT);
dcMem.DrawText( Label, Client, DT_CENTER | DT_VCENTER |DT_SINGLELINE );
dcMem.SetBkMode(OldBkMode);
dcMem.SelectObject(pOldBitmap);
dcMem.SelectObject(OldFont);
dcMem.SelectObject(OldBrush);
if(FontSize>0)
MyFont.DeleteObject();
dcMem.DeleteDC();
SetBitmap( HBITMAP(m_Bitmap) );
SetWindowText(Label);
SetCheck(nCheck);
}
sft
|
|
|
|