|
Hi benjymous
Thanks for your reply
well i am also thinking about your 1st option
so are you sure if a website is running google ad sense then it should contain the keywords like "google_ad_client" ?????
Thanks
Anil Veeraghattapu.
|
|
|
|
|
Well, their javascript block has been formatted like that for a good few years, so if they changed it, it'd probably break all the sites using adsense, so it's a fairly safe assumption that it won't change, but it's never guaranteed!
|
|
|
|
|
Hi,
How to define an inline array size inside the stucture.Sample code i'm attaching the code block.
I'm using MarshalAs unmanaged it's working fine.
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
public struct tPacket {
public ushort word1;
public ushort word2;
public byte byte1;
public byte byte2;
System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst=8, ArraySubType=System.Runtime.InteropServices.UnmanagedType.I1)]
public byte[] array123;}
And i used a struct which has a create method that fills out the array but it thow an error
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
public struct tPacket {
public ushort word1;
public ushort word2;
public byte byte1;
public byte byte2;
public byte[] array123;
public static tPacket Create() {
return new tPacket() { array123 = new byte[8] }; }}
please help me.
With Regards
Mahesh
|
|
|
|
|
Hi,
some comments/questions:
1.
if you get an exception, you should provide all the information about it.
2.
with a using System.Runtime.InteropServices; statement at the top, you don't need to fully qualify all the Marshal attributes.
3.
why do you define your struct twice? and differently?
4.
most often a struct gets a constructor, taking some parameters, and initializing all members. So you don't really need a Create() method.
5.
your code, and several variations on it, work for me. as in:
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct tPacket {
public ushort word1;
public ushort word2;
public byte byte1;
public byte byte2;
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst=8, ArraySubType=UnmanagedType.I1)]
public byte[] array123;
public static tPacket Create() {
return new tPacket() { array123 = new byte[8] };
}
}
...
tPacket p=tPacket.Create();
for (byte i=0; i<8; i++) p.array123[i]=i;
6.
For readability code needs indentation. And PRE tags tend to preserve such formatting.
Luc Pattyn
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Hi,
Thank you for our reply.
Actually i don't use the MarshalAs attribute to declare the array size in the structure.
And i want to read the 48 byte of data from the file.
and allocate the 48 byte of data into my structure.
the structure member break off will be
UInt16
UInt16
Byte[3] ==>3 Byte data-->This is my array to hold the 3 byte of data
Byte[3] ==>3 Byte date-->This is my array to hold the 3 byte of data
UInt16
UInt16
1 Byte
UInt32[8]==>32 Byte data-->this is my array to hold the 32 byte of data
1 Byte
But at once shot i want to copy my structure.
for the i used Marshl
But now i'm not to use the marshal
i have to use the BitConverter Class
using that how to copy my struture.
With Regards
Mahesh
|
|
|
|
|
Hi,
1.
without Marshal attributes any array embedded in a class or struct will be a reference, not the actual data (so it takes 4 or 8 bytes for Win32/Win64); so you need ByValArray and SizeConst .
2.
Your Int32 array is badly aligned; when a data item isn't naturally aligned, there will be a performance hit. If you can freely choose the struct layout I recommend:
- either to move the largest types first (longs, ints, shorts, bytes)
- or to explicitly add padding bytes so each element aligns on its natural boundary (i.e. each int is at an offset that is a multiple of 4).
Luc Pattyn
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Hi,
Is it possible copy by using BitConverter class
With Regards
Mahesh
|
|
|
|
|
No.
BitConverter converts predefined value types (boolean, char, int, double, ...) to/from bytes or another predefined value type, as should be clear from the documentation. It does not handle user-defined structs nor arrays.
Luc Pattyn
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Hi,
i have created text to image conversion.
i need image to hexa format???
bez of i want to sent serial port in hexa format.
please anyone help me ....
Yours,
KaNNaN
-----------------------------------------------------------------
"Success is When Ur Signature Becomes An Autograph"
Mail To : foreverkans@gmail.com
|
|
|
|
|
Why? The hexadecimal formatted string would get sent through the serial port as bytes anyway. You might find it simpler to Save the Bitmap to a MemoryStream, then writing the raw bytes to the SerialPort instead. To convert the MemoryStream to a Byte array, use the ToArray method.
|
|
|
|
|
thnx for reply...
give me some example..
Yours,
KaNNaN
-----------------------------------------------------------------
"Success is When Ur Signature Becomes An Autograph"
Mail To : foreverkans@gmail.com
|
|
|
|
|
No. I wouldn't be doing you any favours if I sent you the code. The code for converting an image to a byte array is publicly available, as is the SerialPort class.
|
|
|
|
|
Dear All, I have following Query in Acces. I am trying to alter this query. How can i write the alter Statement for this query using c#?
PARAMETERS comId Guid, subprojId Guid;
SELECT Community.CommunityID, Community.CommunityCode, Subproject.SubprojectID, Subproject.SubprojectCode, IIf(Subproject.SubprojectStatusID In (1,2,4),Subproject.PlannedNSPBudgetAFA,IIf(Subproject.SubprojectStatusID In (3,5,6),Subproject.ActualNSPBudgetAFA,0)) AS TotalSubProjectBudget, zSubprojectStatus.SubprojectStatus, Subproject.SubprojectStatusID, Subproject.PlannedCDCBudgetAFA, Subproject.PlannedStartDate, Subproject.PlannedEndDate, Subproject.DateForm7Filled, Subproject.ActualNSPBudgetAFA, Subproject.ActualCDCBudgetAFA, Subproject.ActualStartDate, Subproject.ActualEndDate, Subproject.PMUSFSRApprovalDate, Subproject.ActualSkilledLabors, Subproject.ActualUnSkilledLabors, Subproject.SubprojectCompletionReason, Community.BGEntitlementAFA, Subproject.PlannedNSPBudgetAFA, vw_getPaidInstallments.PaidActualNSPAmountAFA AS PaidInstallmentAFA, IIf(IsNull([vw_getRemainingCDCBudget].[RBGE]),[BGEntitlementAFA],[vw_getRemainingCDCBudget.RBGE]) AS RemainingBG
FROM (Community INNER JOIN vw_getRemainingCDCBudget ON Community.CommunityID = vw_getRemainingCDCBudget.CommunityID) INNER JOIN ((Subproject INNER JOIN zSubprojectStatus ON Subproject.SubprojectStatusID = zSubprojectStatus.SubprojectStatusID) LEFT JOIN vw_getPaidInstallments ON Subproject.SubprojectID = vw_getPaidInstallments.SubprojectID) ON Community.CommunityID = Subproject.CommunityID
WHERE (((Community.CommunityID)=[comId]) AND ((Subproject.SubprojectID)=[subprojId]) AND ((Subproject.SubprojectStatusID) In (1,2,3,4)));
would appreciate only the alter statement to update this query.
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
Solved!!!
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
I have create a property of System.object return type
I want to change its Type at runtime according to my need.
for example I want to convert it into System.String or System.Enum.
is it possible ?
Thanks.
|
|
|
|
|
You can write a generic method, I'm not sure if you can write one where the generic type specifies the return type, but I expect so. Or you can cast your object to whatever you like, but the real kicker is, how do you get the method to return objects of different types all the time ? Generics will do that, but how do you define the instance of the object to have the value you want, if it could be any type of object ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I want to implement dropdown list in web parts in asp.net 2.0, so that i can implement personalization.
there must be Enum to use dropdown list.
I have created Enum Dynamically. I already created a Propert of System.object return type. now i want to change its return type as per Enum, i created dynamically.
Thats why i need some solution of it.
if you have any idea, please let me know.
Thanks.
|
|
|
|
|
I already told you the only solution that might possibly work.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
hi i have added a combobox column to my datagrid and i want to populate it with integer list.how can i set data type of this column to hold integer values.
|
|
|
|
|
I understand you have set the DataSource of the DataGridViewComboBoxColumn, as well as its DisplayMember and ValueMember properties.
When you have done so, just set the ValueType property of it, like so:
((DataGridViewComboBoxColumn)dataGridView1.Columns[2]).ValueType = typeof(Int32);
Obviously, changing the name of dataGridView1 to your datagridview's name and the index (in this instance: 2) to the index of your combobox column.
Hope it helps.
var question = (_2b || !(_2b));
|
|
|
|
|
how should i place the datetimepicker in datagridview
using c# 2008
|
|
|
|
|
You'll have to be a little more vague with your question.
What do you want, what have you tried?
only two letters away from being an asset
|
|
|
|
|
i want to place a column, and for each cell in a row. will have a datetime picker control.
|
|
|
|
|
OK, what have you tried so far? Is this for ASP.NET or WinForms?
Create a template column and add the datetime picker.
only two letters away from being an asset
|
|
|
|
|
Sir, can u please suggest me for window application ?
|
|
|
|