|
In addition to palbano's post, you might also want to provide the snippet of code that is not working. It'll make suggestions a lot more meaningful.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hi everyone,
I wanted to know about the connection string for connecting to an Oracle database that is not registered in the system DSN.
For example, for connecting to SQL Server I use:
"DRIVER={SQL Server};SERVER=xp01;UID=user;PWD=pass;APP=Generic32;DATABASE=SOMEDATABASE";
However, I cannot figure out the connection string for an Oracle database. I always have to use a DSN.
Can someone help me out with it?
Thanks,
Sincerely,
Pankaj
Without struggle, there is no progress
|
|
|
|
|
This article[^] has an example connection string for most DBs including Oracle.
Michael
CP Blog [^]
|
|
|
|
|
Perfect! Thanks a lot for pointing that one out.
CP is amazing
Sincerely,
Pankaj
Without struggle, there is no progress
|
|
|
|
|
I should know this by now, but what variable is 16 bytes, and which one is 64 bits?
thanks
wWw.KruncherInc.com - My cool programs
|
|
|
|
|
Do you mean 16 bytes or bits?
16-bit is a short int.
Are you looking for a 64-bit integer? If so, use __int64. Just remember it's Microsoft specific though.
Jeremy Falcon
|
|
|
|
|
I'm trying to read the ".lnk" header, I found the specs here http://myfileformats.com/download.php?url=/files/shortcut.zip&id=5870&name=LNK
under "The File Header" Im looking at
offset 4h contents GUID of shortcut files
offset 1Ch contents Time 1
offset 24h contents Time 2
offset 2Ch Contents Time 3
wWw.KruncherInc.com - My cool programs
|
|
|
|
|
I'm not exactly sure what you are asking.
offset 4h contents GUID of shortcut files is 24 bytes in length
offset 1Ch contents Time 1 is 8 bytes in length
offset 24h contents Time 2 is 8 bytes in length
offset 2Ch Contents Time 3 is presumably 8 bytes in length
A char is one byte. A short is 2 bytes. A long is 4 bytes. An int is the same size as the system word (4 bytes in 32-bit OSs).
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
LOL fine, what is a 64 bit int in C? Not platform specific?
|
|
|
|
|
KingKruncher wrote:
what is a 64 bit int in C?
long long , but not all compilers support it.
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"
|
|
|
|
|
A Microsoft-specific __int64 type exists.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclang/html/_langref___int8.2c_.__int16.2c_.__int32.2c_.__int64.asp
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I've an application written in MFC. The main window is a subclass of CFrameWnd . I'd like to have an option to set the window always-on-top, so I've got a check menu item "Always on top" on my "View" menu. The command handler for this (method OnAlwaysOnTop ) checks the state of the menu item check, toggles it (this works fine) then calls this->ModifyStyleEx( 0, WS_EX_TOPMOST ) or this->ModifyStyleEx( WS_EX_TOPMOST, 0 ) depending on whether it is setting or clearing the state respectively. For some reason I always get a zero return from ModifyStyleEx() meaning it has failed (non-zero means success) and the window does not go topmost.
- Can a CFrameWnd (or a derived class) have the WS_EX_TOPMOST extended style set?
- Does the WS_EX_TOPMOST extended style actually mean always-on-top or does it simply bring to front until another window is activated?
- The window is created using Create() , in order to use extended styles must I use CreateEx() ?
In the debugger this is definetly the correct derived class.
Any tips on how I can achieve this feature?
Thanks all in advance. Please ask if I have been unclear on anything or you need more information.
Cheers,
Robin
|
|
|
|
|
Look at SetWindowPos()
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
Works a charm, I used:
SetWindowPos( &wndTopMost, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE );
Thanks a lot
|
|
|
|
|
I know what you will say: There are some sources on this site....
all I find was in MFC,
Here is my probleme:
if I do this:
case WM_INITDIALOG:
{
DragAcceptFiles(hwnd,TRUE);
........
...
}
no problemo, I catch the WM_DROPFILES
but I want it for my list view control (IDC_LIST1)
so I did that
case WM_INITDIALOG:
{
DragAcceptFiles(GetDlgItem(hwnd,IDC_LIST1),TRUE);
........
...
}
and impossible to catch the msg...
I try to catch everywhere, whitout result..
if someone can help me!!!
|
|
|
|
|
youpiyoyo wrote:
I try to catch everywhere
Did you try subclassing the list control?
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
How do I subclass the list control????
|
|
|
|
|
Type CListCtrl in the Search window and click the Go button
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
As I had said before in the title, it was coded in api win32, and not in MFC,
so for the CListCtrl it won't work.....
I try something with windowlong...
|
|
|
|
|
MFC does not change the way a control works. All the same styles, messages and structures apply equally.
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
ok thank you for your help, I finally found it, you tell me the truth, with subclassing...
for people who are interesting there is my solution:
<br />
WNDPROC wpOrigEditProc;<br />
<br />
LRESULT APIENTRY EditSubclassProc(<br />
HWND hwnd, <br />
UINT uMsg, <br />
WPARAM wParam, <br />
LPARAM lParam) <br />
{ <br />
if (uMsg == WM_GETDLGCODE) <br />
return DLGC_WANTALLKEYS; <br />
if(uMsg == WM_DROPFILES) MessageBox(0,"drop",0,0);<br />
<br />
return CallWindowProc(wpOrigEditProc, hwnd, uMsg, <br />
wParam, lParam); <br />
} <br />
<br />
LRESULT CALLBACK DlgMainProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)<br />
{<br />
switch(msg)<br />
{<br />
case WM_INITDIALOG:<br />
{<br />
DragAcceptFiles(GetDlgItem(hwnd,IDC_LIST1),TRUE);<br />
wpOrigEditProc = (WNDPROC)SetWindowLong(GetDlgItem(hwnd,IDC_LIST1),GWL_WNDPROC,(LONG) EditSubclassProc);<br />
<br />
........<br />
.......<br />
}<br />
...<br />
for people who have questions e-mail me!!!
|
|
|
|
|
I have a dialog with a picture box control on it. Within the picturebox I dynamically draw a CListCtrl object at a random position when the user clicks a button. Now I'm using a CRectTracker object to allow the user to resize and/or move the control. The problem is that when it gets the rect of the control, it gets it relative to the control itself, but when I call the control's MoveWindow function using those coordinates, it moves it relative to the parent window's coordinates, so that if I only move it over to the right one pixel, it moves it to the left coordinate of 1 for the parent window. I've tried using ScreenToClient, ClientToScreen, and I can't seem to get this to work right. Any help would be greatly appreciated.
Here's what I have so far in my control's OnLbuttonDown MessageHandler:
if (m_tracker)
{
m_tracker->Track(this, point, FALSE,(CWnd*)&m_pDlg->m_picWindow );
Invalidate(FALSE);
CDC* pDC = GetDC();
m_tracker->Draw(pDC);
LPRECT rect = new RECT;
CWnd* wnd = (CWnd*)this;
rect = LPRECT(m_tracker->m_rect);
LPRECT rect2 = new RECT;
LPRECT rect3 = new RECT;
m_pDlg->m_picWindow.GetWindowRect(rect3);
this->GetWindowRect(rect2);
wnd->MoveWindow(rect,TRUE) ;
delete rect;
rect = NULL;
}
CListCtrl::OnLButtonDown(nFlags, point);
If it's broken, I probably did it
bdiamond
|
|
|
|
|
bdiamond wrote:
rect = LPRECT(m_tracker->m_rect);
Where is m_rect being defined/assigned?
______________________________
dNimrod#X
________________________
|
|
|
|
|
the rect is set for CRectTracker in this code (that I got from an example on codeproject):
CListCtrl::OnSetFocus(pOldWnd);
CDC* pDC = GetDC();
if (m_tracker)
{
delete m_tracker;
m_tracker = NULL;
}
LPRECT rect = new RECT;
CWnd* wnd = (CWnd*)this;
wnd->GetWindowRect(rect);
ScreenToClient(rect);
m_tracker = new CRectTracker(rect,CRectTracker::dottedLine | CRectTracker::resizeOutside | CRectTracker::hatchedBorder );
m_tracker->Draw(pDC);
If it's broken, I probably did it
bdiamond
|
|
|
|
|
That's somewhat messy including memory leaks. MoveWindow takes coordinates in relation to the client area of the parent window.
bdiamond wrote:
Within the picturebox I dynamically draw a CListCtrl object at a random position
What is the parent window of the CListCtrl?
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|