|
Hi led mike,
I am sorry for any inconvenience before -- everyone improves skills from time to time. My question is do you have any related materials to recommend?
regards,
George
|
|
|
|
|
George_George wrote: do you have any related materials to recommend?
Advanced Windows[^] if you think you are ready for advanced subjects. Based on your posting history you are not read, and likely never will be, but go ahead and take it for a spin if you like.
led mike
|
|
|
|
|
Hi led mike,
It is a good book about Windows internals. But what I am asking is the best practices for data access patterns, do you have related books to refer?
have a good weekend,
George
|
|
|
|
|
George_George wrote: But what I am asking is the best practices for data access patterns
Now that is just a bald faced lie!
Your original post (below) is clearly asking about multi-threading issues. The chapters in Richters book covering threading and threading issues is the best material I have ever read on threading. Read it or don't, it's up to you but I am done playing your stupid game of changing topics in the middle of a conversation. I don't know who the hell you are or why you enjoy playing these stupid games. Maybe you should try to get a girl friend.
George_George wrote: - I want to let client side library to start multiple threads to work efficiently to request for multiple content at the same time other than a single thread pattern;
- But I do not want to hit the server too hard and I also do not want to the library to consume too much resources (memory/threads) on client side to block other work of the client. The library is delivered as a DLL, so loaded into client side process, and will compete for resources of the same process.
Are there any good design patterns for such issues?
led mike
|
|
|
|
|
Thanks for your advice, led mike!
I am sorry for inconvenience.
regards,
George
|
|
|
|
|
I have three tables related in the following way
TABLE1:
<font color="#ff0000">ID (PK)</font>
NAME
<hr>
TABLE2:
<font color="#00ff00">ID (PK)</font>
NAME
<font color="#ff0000">TABLE1_ID(FK)</font>
<hr>
TABLE3:
ID (PK)
NAME
<font color="#00ff00">TABLE2_ID (FK)</font></hr></hr>
How do you populate them in a tree view, I wrote some bad nested loop that I dont want you to see and get confused
Please help me with your clear logic!
Thanks guys!
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
If your ugly nested code works, just go with it. Sometimes, ugly nested code is the only way.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Thanx, but do you all do it that way?? I mean using ugly nested loops?? I really wanna see how others do it!
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
I don't understand when someone comes along and doesn't understand that a little work is involved in getting things done. Many times, the ugliness of the code is directly proportional to the difficulty in its implementation. Remember, if it works and you're on a release schedule, button up the code and move on.
Without seeing your code and being made privy to ALL of the requirements, we can't possibly help you improve it.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Ok, thanks John, I'm happy with it now and this's how it looks:
private DataTable GenDT(string strSelect)
{
DataTable _dt = new DataTable();
new OracleDataAdapter(strSelect, oraCONNECTION).Fill(_dt);
return _dt;
}
private void Populate_treeView1()
{
DataTable dt1, dt2, dt3;
int ID;
string sep, seperator;
sep = ":";
#region Table1
dt1 = GenDT("SELECT * FROM Table1");
for (int x = 0; x < dt1.Rows.Count; x++)
{
ID = int.Parse(dt1.Rows[x]["ID"].ToString());
Name = dt1.Rows[x]["NAME"].ToString();
treeView1.Nodes.Add(Name + sep + ID.ToString(), Name);
#region Table2
dt2 = GenDT("SELECT * FROM Table2 WHERE T2_Table1_ID = " + ID);
for (int y = 0; y < dt2.Rows.Count; y++)
{
ID = int.Parse(dt2.Rows[y]["ID"].ToString());
Name = dt2.Rows[y]["NAME"].ToString();
treeView1.Nodes[x].Nodes.Add(Name + sep + ID.ToString(), Name);
#region Table3
dt3 = GenDT("SELECT * FROM Table3 WHERE T3_Table2_ID = " + ID);
for (int z = 0; z < dt3.Rows.Count; z++)
{
ID = int.Parse(dt3.Rows[z]["ID"].ToString());
Name = dt3.Rows[z]["NAME"].ToString();
treeView1.Nodes[x].Nodes[y].Nodes.Add(Name + sep + ID.ToString(), Name);
}
#endregion
}
#endregion
}
#endregion
treeView1.ExpandAll();
}
Thanks for your time!
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Hello,
I want to set values in Vista registry (in UAC enabled mode) on this (HKEY_LOCAL_MACHINE\SOFTWARE\MyFolder) path but the values are set on diffrent (HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\SOFTWARE\MyFolder) path.
How to set values in that (HKEY_LOCAL_MACHINE\SOFTWARE\MyFolder) path if UAC is enabled.
Plz help me
|
|
|
|
|
You can't write to (or edit) keys under HKEY_LOCAL_MACHINE unless you're in the administrator group.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Embed a manifest in your application to make it run as administrator.
|
|
|
|
|
how to change the shape of forms like circle,elipse etc.,
|
|
|
|
|
Sounds like the title of a book. When are you going to write it?
I googled it, and got a bunch of applicable search results. Try it yourself.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Create A Region of Shape that You want (like Circle, Elipse, Polygon etc..)
Asign the Region To your From by
Form1.Region=mynewRegion;
Hope this will help you going forword . Now try to do it yourself
cheers,
Abhijit
|
|
|
|
|
|
search for sample code here in codeproject
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
[StructLayout(LayoutKind.Sequential, Pack = 1)]
internal struct TBBUTTON
{
public Int32 iBitmap;
public Int32 idCommand;
public byte fsState;
public byte fsStyle;
public byte bReserved1;
public byte bReserved2;
public UInt32 dwData;
public IntPtr iString;
};
const int BUFFER_SIZE = 0x4096;
var localBuffer = new byte[BUFFER_SIZE];
UInt32 processId;
var tbButton = new TBBUTTON();
IntPtr hDesktop = User32.GetDesktopWindow();
IntPtr hTray = User32.FindWindowEx( hDesktop, IntPtr.Zero, "Shell_TrayWnd", null );
IntPtr hReBar = User32.FindWindowEx(hTray, IntPtr.Zero, "TrayNotifyWnd", null);
IntPtr hTask = User32.FindWindowEx(hReBar, IntPtr.Zero, "SysPager", null);
IntPtr hToolbar = User32.FindWindowEx( hTask, IntPtr.Zero, "ToolbarWindow32", null );
UInt32 threadId = User32.GetWindowThreadProcessId(hToolbar, out processId);
IntPtr hProcess = Kernel32.OpenProcess(ProcessRights.ALL_ACCESS, false, processId);
IntPtr ipRemoteBuffer = Kernel32.VirtualAllocEx(hProcess, IntPtr.Zero, new UIntPtr(BUFFER_SIZE),
MemAllocationType.COMMIT, MemoryProtection.PAGE_READWRITE);
fixed (TBBUTTON* pTBButton = &tbButton)
{
var ipTBButton = new IntPtr(pTBButton);
var b = (int) User32.SendMessage(hToolbar, TB.GETBUTTON, (IntPtr) 1, ipRemoteBuffer);
bool b2 = Kernel32.ReadProcessMemory(hProcess, ipRemoteBuffer, ipTBButton,new UIntPtr((uint) sizeof(TBBUTTON)), IntPtr.Zero);
Console.WriteLine(tbButton.dwData + " dwData" );
}
Hello all ,
Am having a problem with TBBUTTON struct in Vista X64.
Am trying to get the dwData (tbButton.dwData) Value from each button, so i can later readProcessMemory of the button, and in vista x64 sp1 it return me always 0x00000... .
In windows XP x86 , works just fine.
Any ideas?
Thanks
|
|
|
|
|
Decad wrote: Am having a problem with TBBUTTON struct in Vista X64
TBBUTTON looks like this
typedef struct _TBBUTTON {
int iBitmap;
int idCommand;
BYTE fsState;
BYTE fsStyle;
#ifdef _WIN64
BYTE bReserved[6];
#elif defined(_WIN32)
BYTE bReserved[2];
#endif
DWORD_PTR dwData;
INT_PTR iString;
} TBBUTTON, NEAR* PTBBUTTON, *LPTBBUTTON;
typedef const TBBUTTON *LPCTBBUTTON;
which doesn't match your structure.
Also, I'm pretty sure the packing isn't 1.
Try
[StructLayout(LayoutKind.Sequential)]
internal struct TBBUTTON
{
public Int32 iBitmap;
public Int32 idCommand;
public byte fsState;
public byte fsStyle;
public byte bReserved1;
public byte bReserved2;
<code>public byte bReserved3;
public byte bReserved4;
public byte bReserved5;
public byte bReserved6;</code>
public <code>IntPtr</code> dwData;
public IntPtr iString;
};
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thank you.
Wrong msdn link from google,
I was watching Windows CE struct ->http://msdn.microsoft.com/en-us/library/ms940418.aspx
and not -> http://msdn.microsoft.com/en-us/library/bb760476(VS.85).aspx
|
|
|
|
|
I hate when that happens.
I've complained about not being able to filter out
the CE docs for a long time.
Did that struct work? I didn't test it so I was pretty much guessing
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Yea it worked fine
Thanks for your time
|
|
|
|
|
Decad wrote: Yea it worked fine
Cool! Good to know.
Cheers
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
we developed a .NET-UserControl and embedded it into a C++-application as an ActiveX via interop. It is placed at an MFC CView-derived class. The problem is that the ActiveX has drawing problems: it is not refreshed quite often, for example when a modal dialog is opened by clicking on a button on the CView and then closed. When you hide the main window and then show it, the ActiveX will be properly displayed again. Thus, it seems like the typical invalidate-problem, the control doesn't get WM_PAINT.
Some tests revealed that the child-controls of the UserControl are actually not redrawn. I overrode the UserControl's OnPaint() to draw a rectangle - after opening the modal dialog and then closing it, the rectangle is still visible on the screen. But the other child windows are not.
Do you have any idea what could be the cause of this strange behavior?
Greetings,
Steven
|
|
|
|